
The Latch allows trains to move forward only when lower limit is reached and continue until the upper limit is reached.
Please note the Red wire from the input to the output on the latch decider it is hard to see.

Conditions for the circuit are shown.