All of that is only possible because of network effects, and a nationalized JR built most of that network.
And honestly, I think you’re overstating the degree of choice you have as a rider. Different lines carved out their corners and companies avoid each other. Service level is generally high, to the point that it’s a non factor. You take whichever train is cheaper/faster, and that’s it.
The problem is that rail has huge positive externalities that are not captured by the operators. You can address that by letting operators speculate on real estate, or you could do it with taxes.
When JR was nationalised, the Japanese central gov't very carefully controlled where private lines could be built. This partly explains why no private lines ran inside of Yamanote line in Tokyo.
Also, the OP specifically mentioned Tokyo, Osaka, and Kyoto. These three cities are special because they have exceptionally high ratio of private train lines. (Yokohama should also be included.) Each of these train lines needed to apply with the Japanese central gov't to have their routes approved. If the competition to the JR national line was deemed too high, the proposal was denied.
Another thing that is frequently overlooked by outsiders who try to explain "rail success" in Japan: For more than 50 years, there was/is a tax deduction where employers buy a monthly rail/bus pass for employees. This was/is not restricted to JR national lines only -- private lines also qualify. As a result, this programme generates huge demand for rail service in Japan. I assume that Switzerland must have something very similar, as the outcome is incredibly similar (rail crazy by any measurement).
And honestly, I think you’re overstating the degree of choice you have as a rider. Different lines carved out their corners and companies avoid each other. Service level is generally high, to the point that it’s a non factor. You take whichever train is cheaper/faster, and that’s it.
The problem is that rail has huge positive externalities that are not captured by the operators. You can address that by letting operators speculate on real estate, or you could do it with taxes.