That's quite an assumption. Yeah, that might be a reasonable (if brisk) cruising speed, but the average is probably gonna be a fair bit slower than that, especially when passing through cities or mountains.
> 6m shipping container, let's say 7m, so 4 every second.
Technically 8 (under the above assumption), since containers can double-stack (though not all tunnels offer enough clearance for it).
Still, real-life throughput's usually gonna be a lot lower than this theoretical maximum (by at least an order of magnitude, if not more), namely because trains can't really be packed end-to-end on a track when moving at any useful speed; they ain't exactly able to stop on a dime, so for safety reasons there's gonna be a fair bit of distance between trains.
Further, if you're going to count the time it takes for ports to load/unload containers, then it's only fair to do the same for train depots.
By this analogy, no need to limit to one port, either.
But even this analogy doesn't quite hold true, because tracks v. ports are apples v. oranges. The proper comparisons here would be tracks v. navigation routes and ports v. rail depots.
6m shipping container, let's say 7m, so 4 every second.
Largest container ports do 40 million containers per year, that's about 1 per second.