If you are using DC, by isolating blocks of track that can have the rail polarity changed, or if you are using DCC, then there shouldn't be a problem because polarity is not an issue. DCC uses the rails for power, but the direction and speed are controlled by a reciever in the locomotive.
If...