The trains stop around midnight and don't start again till 5am or 6am, so if you miss the last train you have a few choices; drink till morning, crash in a capsule or other cheap hotel/sauna, go to an internet cafe and sleep in the cubicle, go to a karaoke room till the trains start again, or get an expensive-as-hell taxi home.
The last option being the least preferred, if you decide to rush for the last train home, you'll often see guys like this who really should have taking one of the other options.