LuaEntity doesn't contain key passenger.
GUI.lua:217 and GUI.lua:221
Due of removal of "passenger" from vehicles, and being replaced with get_driver/set_driver, and get_passenger/set_passenger, which don't exist for trains.
First is easy to fix, player.driving = false pulls players out of their vehicles. Second there no longer appears to be a way in the API to put a player into a train. The individual carriages of a train and the train itself don't support get/set passenger/driver.