Using two 12V batteries, while simultaneously charging?
I expect that the two outputs of the charger really come from the same power source, so share a common ground - if that is the case, your plan won't work, as the common ground connection will short the "bottom" battery.

However, if the charger outputs are isolated, or you use two independent chargers, it would work (but be sure that the DC outputs of the chargers are not connected to the AC ground in any way).