Testing the condition of an old sealed-lead-acid (SLA) battery
It sounds like both batteries are likely end of life, but testing them is a great way to determine if there is useable life remaining.  I'm assuming that you don't consider the burglar alarm to be mission-critical, as using a marginal battery in applications that really need reliable power is a bad idea.

First, measure the terminal voltage during charging (but after they've been on the charger for at least 24 hours).  The terminal voltage should be between 6.0V and 7.5V.  If it's less than 6.0V, you have a shorted cell and should recycle the battery; it's done.

Next remove the cell from the charger and measure the terminal voltage.  If it is 6.0V or greater, there may be some useful life remaining in the battery.  Reference a typical VRLA battery terminal voltage vs SOC curve below (note that this is for a healthy battery).



Finally, connect a load such as a 6V light bulb across the terminals while measuring the terminal voltage.  If the battery lights the lamp and the terminal voltage stays above 5.8V or so (assuming a ~500mA load), you're probably OK given the caveats about not using marginal batteries in important applications.