The program should allow trains to leave the route by checking if the train is within the final block.