The two green wires go back to the station with Read Stopped Train, that puts a number in T if there is a train stopped at the station.
The top signal is set to Close if T > 0, so it will open when the train is leaving, this allows the next train to start at the same time as the current train is leaving. The second signal has two purposes, first it blocks the top one from turning off when the current train hasn't yet moved, and second it detects the second train as it passes. The other combinator keeps the signal red until the second train is at the station, this prevents a third train from trying to get into the station too soon.
Blueprint