Re: What's to stop...
The person doesn't even have to be on the train themselves. A Raspberry Pi, a battery and a little code plus some double sided tape would do the trick.
The ultimate security device. Deploy some of these devices in places you want to keep people out of and if they also have a phone with an app telling them they are nearing somebody infected, they bugger off in the other direction.