The simple railroad idea is “big ship comes to west Panama, unloads onto trains, which load into big ship in east Panama” but that avoids the strength of railroads.
You have to unload the ship eventually anyway, so you instead have it load into rail and disperse to final destination more directly.
You’d need a heat map of where everything ends up that is going through Panama, but if you’re dumping to rail many of those ships would unload elsewhere.
Or in other words, Europe will be hit much harder by this than the USA will.