In the U.S. they often double stack containers--so that would be half the distance if they could:
"Invented in the United States in 1984, it is now being used for nearly seventy percent of United States intermodal shipments. Using double stack technology, a freight train of a given length can carry roughly twice as many containers, sharply reducing transport costs per container."
https://en.wikipedia.org/wiki/Double-stack_rail_transport
But generally going around the southern tip of South America could well be cheaper--although it may take longer.