The post is edited.
Originally if there was a real ground (not the bottom battery's "-") I was asking the same question, but it was unclear what will the ground (1 PCB layer) do. If there were 2 separate grounds (1 layer for each ground is what I was thinking, the block diagram is "with grounds.jpg" in this post) I could have put the upper battery's voltage divider to 1 ground without connecting it to the upper battery's "-" and connect the lower battery's voltage divider to a second ground, so even when the switch between the 2 battery's is turned on, the voltage divider of the upper battery will be functioning without the 12V from the lower battery being applied? Now the problem escalated to this:
The problem is this (block diagram in this post, files: "no.grounds.jpg" and "without.grounds.jpg"). The 2 batteries will have a switch between them, to only disconnect the upper battery's "-" from the lower battery's "+" when the load (24V) is disconnected, and charge them separately (1 battery to 1 charger). In this case, what will happen to the voltage divier for 24V ("2.batteries.off.on.block.diagram.jpg")? Also its impossible to use a voltage divider for the upper battery (connected to the upper battery's "+" and upper battery's "-"), as when the 2 batteries are in series (24V), the voltage applied on the upper battery's voltage divider will be 13V (connected to top battery's "+" and top battery's "-", because if we have resistors with a battery under them, the voltage of the battery under them is also applied. I hope this makes it clear. On the other file ("Switch.batteries.comparators.pdf") I have the 2 analog comparator monitor circuits (for each battery of 12V) and I am hoping that everything is ok, but I think on the dividers a higher voltage will be applied again when the switch is on?
Voltage dividers:
https://www.dropbox.com/s/b91za1bkvqaxfzq/2.batteries.off.on.block.diagram.jpg?dl=0
Comparator circuit:
https://www.dropbox.com/s/x4bu332c0eloz7k/Switch.batteries.comparators.pdf?dl=0
No grounds block diagram:
https://www.dropbox.com/s/fllotw5yuljd6hs/No.grounds%20%282%29.jpg?dl=0
With grounds block diagram:
https://www.dropbox.com/s/wzvv5hjhghkfciy/With.grounds.jpg?dl=0
Please attach the files, rather than using an external upload service.
Putting the reverse protection diode in series with the negative rail of the comparator IC, is a bad idea.
The ground point is just a common reference from where all voltages are measured from. It's possible to have more than one ground reference node, at difference voltages, relative to one another.
Just build two separate circuits, without connecting their grounds together. As I keep saying, if you need to tell which LED is on, using a microcontroller, use an opto-coupler. If you don't know what that is or how to use it, then use a search engine. Post a schematic and I'll review it.
Is it possible to connect 2 chargers. while the batteries are still in series? 1 charger per battery?
Yes, if the charges are powered from isolated power supplies.