These were for the people that missed the last subway/rail home late at night, because taxi fares are high there.
Sad to hear that there are people that live there permanently.
BTW, economy in Japan is really bad. I go to Tokyo 2 - 3 times a year for work and leisure. During the past few years, I noticed that there are more and more homeless people in Tokyo. Many are quite young (probably around 40 years old). These people cannot even afford capsule hotel......