I was setting up an automated rail crossing, and was using the signal from the gates on the tracks to know if a train was there or not. But the other gates unlock before the train finishes passing (while the gate on the rail is still open).
Images
As it starts crossing:
A few moments later:
I was trying to avoid using signals to not mess with the rail network or run cables to existing signals but...
Attached is the save where I was testing this.