So, your 48V battery is made of two 24V batteries in series? What I might do:
Conceptually simplest: A 24V inverter big enough to supply an 80A 48V battery charger.
Most Rube Goldberg: 80A or better SPDT DC relays alternately connecting one or the other 24V battery to the generator, though at least 80A diodes (Schottky, if you're feeling lucky), I think, (this is off the top of my head, whether the diodes are required I can't be sure, but, it's better to have them and not need them than not have them and need them to protect your expensive stuff), switching perhaps every few minutes. Or maybe tens of minutes, so the relays don't die quickly. Probably it would be better to build a switching circuit which turns off the output power on the generator before switching the relays. You would need two 24V BMS which allow series connection.
For the Rube Goldberg, you would have to be sure the generator, or the battery, or both, are not grounded. As to diodes, I've become somewhat enamored of using 50V Schottkys for connecting things (like DC-DC converters) during testing of my 24V system, because if I don't, unexpected things happen. I may take some of them out when my design is final. If that ever happens.