As others have said..
If you can fit them, they will be fine. - They quite often come from alarm engineers, where the backup batteries are changed as a 'routine maintenance' item..
Those from Uninterruptible Power Supplies for computers et al, are quite often beyond use.
You do really need to charge / discharge cycle them for a long life, but if they were free, you may not want the aggro of that..
A smart charger should cope with them.. It will do newer technologies, so not a waste of funds.. Use them if they will fit, and suit your loco's, until they die.. - You should also get a small amount form the 'scrappy' at end of life.