The batteries could be bad just because they are not maintained in a charged condition. Or because they have been cycled to their limit and simply need to be replaced.
How many (6 volt) batteries are in the machine?
How are they connected together?
What is the operating voltage of the machine?
Get the manual for the machine. There may be a procedure the charge it or a special charger designed just for the machine.
Check for a bad connection on the battery cables by removing and cleaning all connections then try to charge them.
What is the brand and model #?