Cargo trains are much longer than container ships (at least in the US). The average train is over a mile long, and trains that are 3 or more miles long are not uncommon. A single ship is of course still going to carry a lot more cargo, but don't underestimate the throughput of trains.