Connecting a single end stop to two circuits
Probably the simplest practical way is to use a relay that has isolated output contacts for circuit A and circuit B. Use the original end-stop switch to activate the relay from a simple power supply such as 12 volts DC. This would need a 12 volt relay.