Every major station I went to in Japan had a huge mall with restaurants connected to it owned by the rail company. Inside stations were rail company owned gift shops, convince stores, etc.
I think Japan is successful because of a less pervasive car culture than the US. People expect to walk 30 minutes to the train in the morning, that's just something you do. It would be unheard of in the US (and also dangerous in many suburbs, because they are designed to move as many giant SUVs as possible per hour, not to let pedestrians and cyclists get to the train station).
Also, a big caveat is ... all of this is Tokyo and Osaka, very large, rich, and dense cities. When you go out into the middle of nowhere in Japan (even an hour out of Tokyo, think the Hachikō line, etc.), rail service kind of sucks and is subsidized heavily.