Yeah, some engines are better than others, and some engine installations / integrations are better than others. To be successful and reliable, both of those elements need to be good. Do a bad job of installing an excellent engine, or an excellent job of installing a bad engine, and it will be unreliable.
As far as an on board engineer goes, some of them have an entire engineering department, with enough skills to essentially completely rebuild these engines at sea. Replacing heads, pistons, rods, etc is no big deal for a good ship's engineer (beyond inconvenience).
The main advantage for reliability in the marine environment is an endless supply of cold cooling water, as long as you keep the sea chests free of marine growths and creatures (e.g. you can get a colony of mussels living and growing in the intake). For those not familiar with marine diesels, they typically have a normal closed loop cooling system filled with the usual engine coolant mix, but have heat exchangers in place of radiators, running seawater through the other side of the heat exchangers. As long as the systems are properly designed, maintained, and the pumps keep running; they have a much easier setup for thermal regulation.
Cooling is so plentiful that it's not unusual for smaller marine diesels to have a cooled exhaust system, limiting the very hot pipes to only immediately adjacent to the heads.