Assuming the charger was intended for use with rhe toy, which is what you are saying, then how old is the battery? It coulkd have either gone low capacity through frequent use or sulphated up due to long periods of idleness in a discharged state.
If the former, probably not a lot to be done to save it, but it could be worth discharging it through a suitable load (even the toy itself) and then charging it again - repeat many times until the discharge time lengthens to a reasonable level. Fingers crossed!
If it's the former and it's a wet-plate battery (and not a gel type sealed one), you can do something similar but empty the electrolye ( the acid inside) out - and SAVE it - and refill the battery with plain water. charge/discharge the battery over many cycles and if you are lucky at least some of the sulphate will dissolve away, restoring more capacity for the battery.
PLEASE be careful if you attempt Plan B as the electrolyte is dilute (but still dangerous) sulphuric acid and will eat clothes, furniture - and YOU!
Ron.