Yes, you can charge each battery independently from separate solar panels as long as each is electrically isolated.
However, it would make more sense to combine the panels and charge the whole 24 V battery as one. Lead-acid batteries are fairly forgiving, especially in that you can charge them with a current-limited voltage supply. A 12 V battery can be held indefinitely at about 13.6 V without harm. It will draw some charge current at that level, but this current won't do long term harm even if the battery is already fully charged.
A power supply that takes the solar panel output and makes the roughly 27.2 V output should work fine. The more cells in series, which in this case is 12 instead of the usual 6 of a "12 V" battery, the more you have to worry about cell imballance. You might therefore want to be a bit conservative with the float voltage and/or make the current limit lower than usual. The easiest way to do that is to size the solar panel such that it simply can't produce enough power to hurt the battery in full sunlight. Then the power supply only needs to try to produce about 27 V, but fold back as necessary limited by the power from the solar panel. This scheme will give up fast charge time, but if that is not a issue it's intrisically safe operation makes things easier.