Not to do with their prison system. I actually like some of Japan's policies. They have certain types of private services that are incredible.... But would never work here in America due to public mentality.
Am surprised though that total strangers have conversed with you, a foreigner, on the trains. Vast majority of the time, a foreigner sits down, he can expect Japanese citizens on either side of him to get up and move away. Very insulting. Though thankfully that practice seems to be lessening significantly in recent years.