But running the numbers on it, you really can't compete on throughput, what with the truly massive capacity of cargo ships. Like, even if it had only 3000 conatiners, it only has to go at 1/1500th of the rail speed (assuming you can stack them two-high) to beat it. This page[1] says panamaxes have traditionally held 5000, with "New Panamax"es carrying 13,000.
(Edit: ChatGPT tells me that transit of the canal takes 10 hours on the high side, and it's 82 km long, so that's an effective ship speed of 8.2 km per hour, meaning the rail would have to go 20,000 km/h to compete on throughput.)
But yeah, the other advantages you mention would apply.
[1] https://en.wikipedia.org/wiki/Panamax?useskin=vector#Cargo_c...