Update Train controller

Implemented the failure condition, also fix the problem that when a new
authority is assigned, the train will not automatically start