It would be feasible to get an injunction banning rail travel and, if the person broke the injunction, either being recognised, or informed upon, then that could amount to contempt of court.
In the UK, it's common enough to find such conditions in ASBOs and it is frequently applied in bail conditions, apparently, for rail-related transgressions.
Enforcement and detection are the issues - though, face-recognition technology is improving all the time.
Lifetime and temporary bans from football grounds are fairly common here, and suffer from the same difficulty of detection as a railway ban would, though the scenes and times are rather more restricted, I suppose.