The correct answer is A. to ensure that each switch is correctly set.
A point lock is a device that is used to prevent a railway switch from being moved from one position to another unless it is in the correct position. This is done to prevent derailments.
Option B is incorrect because the point lock does not prevent the point from being operated while the train is on it. In fact, the point lock must be released in order to move the switch.
Option C is incorrect because the point lock does not detect any obstruction between the tongue rail and the stock rail. This is done by a different device called a derail.
Option D is incorrect because the point lock is used to ensure that each switch is correctly set.