I am not sure that I entirely understand what you want to do and you would need to give far more details for a complete design. However, these are my first thoughts, for what they are worth:
Firstly you need a way of sensing that the battery is disconnected.
One way is to:
1) have a reverse voltage blocking diode between the battery connectors and charger.
2) take a 48V dc unstabilised supply and connect it via the coil of a 24 volt relay to the battery terminals. This 48 v supply only has to source enough power to operate the relay - so will be tiny. Depending on the charger design, you may be able to source this voltage from inside the charger.
With the battery disconnected, the voltage across the battery terminals will rise to 48V dc because of the second supply and the relay will not energise because no current will flow. The blocking diode will stop this voltage finding its way into the charger.
With the battery connected, the voltage across the battery will fall to the charging voltage and the relay will energise, using the voltage difference between the battery terminal voltage and the 48v supply.
Use the relay to change-over your pair of inputs between your two sets of outputs.
lets see you have 2 inputs & 2 outputs., Do you want to switch the outputs to 1on/1off ~ 1off/1on ~ 2on ~ 2off ? from the same input ? which one is it ?
[Guessing] you would need two seperate relays powered by the availabe source (48vcd?) so when you plug in the battery condition 2on would occur and when you took the battery off condition 1off/1on would occur is that it? this way when you place the battery back on the charger the
1on would engage the other contact and start recharging again.
I don't have the fogiest idea how you would do that };-)
A pulse generator connected to the battery and a missing pulse detector connected to the charger. As long as the charger is connected to the battery, it detects the pluses which are superimposed on the DC. When the connection is broken, a relay that was energized as long as there were pulses drops out. Its points are wired to cause the input pair to switch to the opposite output pair.