According to Wikipedia[1], "Container ship capacity is measured in twenty-foot equivalent units (TEU)."
And container ship size categories are (conveniently!) based on what can fit through the Panama Canal. Neopanamax ships are the category that can fit through in the canal's new (upgraded) configuration, and those can hold 10,000 to 14,500 TEU.
For round numbers I'll use 10,000 TEU. That means if you laid all the containers end to end, they would stretch out 200,000 feet, which is about 38 miles or 61 km.
Trains can stack containers two high[2], so divide that by two, and a train has to be at least 19 miles or 30 km. But really somewhat longer since one train car's containers don't butt up directly against the next car's containers.
So presumably they would need multiple trains for one ship's cargo.
---
[1] https://en.wikipedia.org/wiki/Container_ship
[2] https://en.wikipedia.org/wiki/Double-stack_rail_transport