As the caboose clears the signal (optical detector), it changes to green, the are no more trains coming in this direction.