will this work? yes
is it a good idea? not completely there are better portable power sources
Issus with any lead acid batteries. Sealed AGM or regular. There heavy, prone to leaking. And aren't good for being discharged pasted 1/2 they start self-destructing faster.
Now depending on how your batteries are you could get a high capacity LiFePO4, lihv. For the same price maybe a little more, then a lead acid.
other options would be a super capacitor bank and a Soler panel.
what capacity of batteries you needing charge.
there even a very small genie.