Here's the final version. The lights are now working correctly and I've added a bit of bounce to the barriers and doubled the lenght of the train:

DEMO