When train travel was fairly new, somehow the idea took hold that rising on one could cause a man to go insane. There were tales of socially unacceptable behavior, particularly fights and attacks on women. And these made the news, which made the incidents seems more prevalent than they were.
As the railway grew more popular in the 1850s and 1860s, trains allowed travelers to move about with unprecedented speed and efficiency, cutting the length of travel time drastically. But according to the more fearful Victorians, these technological achievements came at the considerable cost of mental health. As Edwin Fuller Torrey and Judy Miller wrote in The Invisible Plague: The Rise of Mental Illness from 1750 to the Present, trains were believed to “injure the brain.” In particular, the jarring motion of the train was alleged to unhinge the mind and either drive sane people mad or trigger violent outbursts from a latent “lunatic.” Mixed with the noise of the train car, it could, it was believed, shatter nerves.
The novel experience made people nervous, which probably sparked some incidents. Train travel also caused people of different classes to be inclose proximity, which may have exacerbated anxiety. But over time, people got used to travel, mad "railway madness" seemed to disappear. Although modern-day riders know that if you ride a commuter train every day, you're going to see some strange behavior even today. Read about railway madness and the trouble it caused at Atlas Obscura.