I'm not sure that this is an apples to apples discussion.
First, mines do have some ventilation. Surely no one is really suggsting CO2 emissions from diesels are so low you can run one in a closed environment.
Second I doubt you could run the size of powerplants you find in the ocean freighters in any mine, anywhere. They are beyond huge.
Third, there is some perspective missing here: the problem is how many of these behemoths are plying the world's oceans.
Fourth, as far as I can determine, ocean-going freighters don't burn diesel, they burn bunker fuel, which is less refined than either gasoline or diesel and burns much dirtier.