system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: If trains use diesel engines as a generator to then power electric motors, why don't cargo ships do the same?
gpt
Because trains have to go on land.

Trains operate at anywhere from 1mph in the yards to 60+mph out in the midwest. They have to climb up hills, go round turns, go back down hills, etc. and all this means different amounts of energy are required.

Problem is, diesels - especially big ones - have one RPM where they're most efficient (producing the most mechanical energy for a given amount of fuel). That's why trains have electric motors - they are just about the same efficiency at any speed, and this allows the diesels to run the generators that power them at their one most efficient RPM. 

The downside is that any time you transform energy, whether it be mechanically (through a gear) or otherwise (going from mechanical energy to electrical energy), you lose some. Always. It's one of the fundamental laws of thermodynamics.

Ships, on the other hand, just chug away in an endlessly flat ocean for up to 99% of their journey with no change in direction or speed. This means they can set their big diesel at its most efficient RPM and just let 'er rip. This is more efficient because the energy doesn't change as much between the fuel and the propeller. On really big ships, there isn't even a gearbox - the propeller is directly connected! They use smaller electric motors to maneuver in port, or use tugboats.