Charging batteries connected in series as isolated groups
I don't see a workaround without switches. 

Closing any of your 4 lower switches will short your Charge Controller.

If your drive motor needs 48 volts, the other bank of batteries can be charging.

1 - DPDT switch can create a 24/48 volt battery bank.

A wiring diagram of 2 Series/Parallel switch arrangement for 2 banks of 4 batteries plus your 24v charge controller. 

As you can see, any number of banks of 4 batteries can be added to the chain.

Keeping things simple.

Any bank switched to “Parallel” will charge. 

Any bank switched to “Series” will provide 48v to the motor

All banks in “Parallel”, will provide only 24v to the motor.

Series/Parallel bank switch

I hope this will make boating more enjoyable. I have an old 'S2' 8.0 sailboat.