But when one train arrives it is common that there is another one arriving at the same time. People exchange lines from one train into another in a few seconds and then both of them depart.
My feeling is that the optimization is not for the speed of the trains. Japanese trains do not go as fast as they can. But all the train system is optimized to reduce waiting time. Each individual train is slightly slower. But the mean time that Japanese travellers spend is reduced.
I would love to see some study about this, as it was just my travel experience. It would be cool to compare that on how ants behave. It will not be the first time that ants have resolved an optimization problem way before even humans existed.