In Japan, there are many rail lines. This is especially true in the big cities. Generally, workers in central cities are not allowed to commute by car. In cities, people mainly use trains and subways for transportation. They are very familiar with the trains and their train stations. Thus, people tend to prefer to find their house located within a 15 minute walk from the nearest train station. It seems that houses located within 10 minutes by bicycle are their second choice. Needless to say, there are many people who have to take a bus from the station to their house. At any rate, train stations are the center of cities and towns. Inevitably, there are shopping malls around major train stations.
Even inside local train stations, there are many shops that satisfy passengers. Inside Ueno station in Tokyo, there is a sport club. I’ve heard that it's welcomed by busy commuters. The nurseries for children that many people are always waiting for a vacancy of are located inside or in front of train stations, since busy working parents, who are often required to work long hours, can save time.
The pictures are of a shopping mall inside Tokyo Station.