I've never heard anything about a train, but I assume the same "rules" apply. Travel is sometimes restricted in the third trimester. This is done by the airline because they don't want you going into labor in the air on their plane. Liability reasons, I'm sure. And it's also suggested not to travel during the third trimester because if you go into labor your doctor isn't there to deliver and it can be more complicated with your insurance out of town or state or country. But it isn't unsafe for you or the baby. Talk with your doctor and see what they suggest for you.
It may be wise not to fly once you reach the third trimester... However, airlines will not restrict it until you are 7 days from your delivery date. If you are within the 7 day period you must have a letter signed by your doctor giving you the okay to fly dated 48 hours or less from the departure of the flight.