That isn't strictly true. Some of Japan Railways is privatised, some of it, including all freight, isn't. There are 6 JR passenger companies, 4 are privatised, 2 aren't
The Infrastructure is in Public hands and before it was floated the government wiped out a shit load of debt
They are also currently going through a sort of Beeching era and closing unprofitable lines.
The way Japanese railways are organised is really strange as some of it is like what happened in the WIld West of America, there are smaller companies that are essentially real estate firms too and they literally develop new rail connected communities. It's not a path anyone could follow in another country.