Japan tried this during WWII, using POWs as slave labor. It was called the Siam-Burma Railroad.
https://iho.int/uploads/user/pubs/standards/s-23/S-23_Ed3_1953_EN.pdf
I think this is the most recent agreement that was actually adopted by the member states. They’ve been trying for years to get that “Southern Ocean” approved but I don’t think it ever has.
This one says that the oceans exclude the seas.
If you go along with that, it looks like the shortest railway from Pacific to Indian would be across Tasmania.