It may not be painless if you move before the train hits, and it certainly won't be painless for the driver. Bare in mind in many places you can be fined lots of money for walking on train tracks. I wouldn't recommend this method due to the risks involved, but anyway I wish you peace and luck.