Charging two lead-acid batteries connected in series, separately (with one solar panel)
The easiest solution is to get a charge controller with 24 V output.  Otherwise, you'd need two separate charge controllers, each isolated from the input.  That is not generally how they work, so that would be more difficult to find and more expensive if you do find it.