I would suggest following things.
1. Use RFID reader in train and tags at station to identify the station.
2. IR sensors to detect when train arrives at station (Smart use of RFID also can do the same). IR sensors can be used to sense that whether there are any vehicles or not.
3. Stepper motors to control the gate opening and closing.
All the best.