Artificial Intelligence is usually teached with robotics in mind. The problem with car like robots is, that the amount of control which is needed is huge. A car has a position, a speed value, a trajectory and a lane on which the toy is operating. The more easier to achieve control problem is given by trains, who can only drive on a single lane. Additionally, the railroad modelling community is much larger than the robotics one, so it make sense to not controls robots, but simulated trains.
A current software for doing so is Open Rails which has a nice 3d interface. What i'm missing is a scripting interface to write an Artificial Intelligence bot. Are train simulators available which are supporting this feature similar to the OpenAI Gym envirionment?