Is this one of those things where you have to complete the circuit by making the entire length of track a complete journey?
it is a simple matter to have a lever change the appearance of the rail. simply set a global switch not just a self switch when you use the action button on the event for the lever.
the lever will be a two page event. both pages will be triggered by the action button the first page will have no conditions the second page will be conditional on self switch A.
the first event page will simply set a global switch to on, and change the appearance of the graphic and set self switch a to on. the second event page will also set the global switch to OFF and change the appearance of the graphic and set self switch a to off.
the event for the rail graphic will have one direction on its first page dependent on the switch being off and another graphic on the second page dependent on the switch being on.
the hard part about your puzzle is knowing if the entire railway is set up in the correct direction and that is a whole nother ballgame.
†*************
Edited from my phone please excuse formatting
***************
Small example - click spoiler for events