I'm assuming it was a puresine inverter?
you can use a transformer and bridge rectifier to make a charger, but i suspect the transformer of a 24vdc inverter as standard will be too low a voltage to charge a 24v battery directly - for powerjack inverters it would output ~16v rms; for some other inverter boards it's more like ~13v. If you want to charge 12v batteries then your OK, although 16v might be a bit too high.
I suggest you try connecting it to the AC line and checking the actual output voltage as a step down transformer, then go from there. If you're not certain the transformer's OK you can connect it in series with an incandescent lamp, say 60 or 100watts; if the transformer's ok the lamp may give a brief flash then go very dim; if the transformer is shorted the lamp will glow at full brightness.
If it's a toroidal transformer it should be fairly easy to add extra turns to change the output voltage if necessary.