Officially there are no train drivers. The name changed to Loco pilots. Similarly there are no guards. The name changed to Train Managers.
Coming to the question u have asked, loco pilot work for only a particular section of rail network. They would take LR (Road Learning) in that section & work only for that section. Loco pilots cannot change the route or direction to whatever direction he wanted to go.
On Railway track, point will be set to one particular route (in above image it was set to right most line when going towards upward direction). Section controller will decide the route of the train & at what time the train to be started. He will give instructions to the particular station master at which train was there. Then SM will give signal through his signalling panel as shown in below picture.
According to the instruction from head office/ section controller, station master will give signal signal to the train to go in that direction. The points will be set automatically in that direction before the proceed/ green light signal appears.
Loco pilot can only control the train speed or troubleshoot in case of any problem but cannot change the direction of train. He follows only the given signal to move the train.
What if the signal is in danger/ red & locopilot tries to move train?
Incase of danger signal, the point will be set to danger i.e if loco pilot moved the train the train will get derailed there will be chance of accident.
Image source: Google