that's how I charge my 24 volt set up ( on board chargers) - simply have a Anderson plug connecting the two batteries .
you gust need to be mindful that you may be discharging 1 battery more than the other which will effect the 24 volt if you go to use your electric
Chris