I did that on the Shanghai-Nanjing section of the Jinghu Railway more than 10 years ago and avoided getting caught...wahahahahahaha! I surfed from Shanghai to Nanjing on one of those old green-skinned trains. I climbed onto the train in a marshaling yard near the Shanghai Railway Station. The train then entered to station and sat there for 2 hours waiting for passengers. I sat on the rooftop the whole time (at that time, there weren't that many security cameras). I was careful to keep my head low not to be electrocuted. They train stopped in Suzhou and Changzhou, but somehow I still avoided getting noticed by the railway police. I made it to Nanjing West Station (the old Republican era Nanjing main station with limited passenger service). But again, that was 2011, when I was a reckless college freshman, while there weren't that many security cameras in non-high-speed railway stations. In fact, there were barely any HSR in China back then. However, since there was a new HSR opened between Shanghai and Nanjing (and Hangzhou), the green train I surfed was quite empty, as most passengers chose the newly built HSR. Nonetheless, I DO NOT recommend anyone doing this. It is dangerous and you are at HIGH RISK of suffering a painful death (either by electrocution or crushing/disembowelment).