Although Japan also has extensive highways, and they're privatized in a similar way to JR (NEXCO East, West, Central) and are nearly all tolled - if you're driving alone, it's often the same price in tolls alone as a ticket on the Shinkansen (but the equation quickly flips when you more people in the car)
The German rail network is chronically underfunded and Germany is completely incapable of building new lines. Per capita spending on rail pales in comparison to e.g. Switzerland and Austria.
It’s not just about size. Much of the U.S. would be cheaper to build rail networks because there is a lot of open, relatively flat land without dense building on it. Japan is very mountainous and has a lot of dense development, and it has to be more resilient in case of earthquakes.
Civil planning on that scale isn’t about feasibility but about what direction you want to shape the county in.
A sparse railway system would leave parts of the country less populated by design as it’s simply harder to get to them. People would bunch up into cities and towns because they had to.