Japan actually does very little in the way of pedestrian or bicycle friendly road design compared to most European countries (there are a few things worth learning from IMO, just not as many as, say, the Netherlands).
It works as well as it does because of the narrow streets and how little car traffic they have (even less than the Netherlands, which does way more to try and reign in cars but has way more of them). They have so little car traffic because you have to prove you have a permanent parking space in order to buy a car, there's no on-street parking, and the public transit network is very extensive. That and the aforementioned narrow streets just make driving inconvenient compared to the other options.