Japanese railway don't easily beat everything in Switzerland. If you look at rural service Swiss service is often just as good or better and more punctual.
Japanese punctuality numbers are inflated because their high punctuality of their high speed trains that run on dedicated separated infrastructure. In fact, large reason that punctuality in Switzerland suffers is because international trains that mess up the schedule (looking at you Germany).
And unlike Japan Switzerland is also world leading in using railway cargo transport, that also has to share the same infrastructure.
But in general, its not just about public and private, that a simplified vision. Its something for politicians to talk about rather then talking about the actual details of the system.
While Japan is privately operated, its certainty still under public control.
In fact in Switzerland there are quite a few railway companies for both cargo and people using the same infrastructure. Some of them are semi-private or owned by local governments or a mix of other organizations. The Semi-Private Post office runs its own trains for example.
It's not a matter of private vs. public.