This must be a different Japan than the one I'm familiar with, where exterior walls are often uninsulated and only a few inches thick and single-pane windows are still the norm in a lot of housing. I wouldn't be surprised if soundproofing were better for railroad-adjacent buildings, but compared to American homes the soundproofing here is surprisingly poor.
Oh, you’re definitely engaging in Magical Japan, here.
While building standards have certainly improved in the past 20 years, the average Japanese house is built just strong enough not to fall over when someone farts. In particular, windows tend to be single pane, and you’re lucky if they block a strong wind, let alone noise.
I’m exaggerating a little, but not by much.
(Which is why we're now tearing down our old house and building a new, stronger one. Post-war Japan was more concerned with a) building a lot of houses, and b) keep lots of jobs, which meant, as far as houses were concerned, building use-and-throw-away houses. Then build another. And another. And don't talk to me about sound proofing.. it's non-existing. What with no insulation in walls.)