The battery or YLB rechargeable capacitor circuit is intended for the continuation of sounds when power is interrupted intentionally (such as sequencing the e-unit conventionally or shutting down the locomotive). It can also be useful for short (less than one second) power interruptions from isolated layout trouble spots.
It is not intended as a fix for a locomotive that is losing sounds frequently and all over the layout. The fix lies elsewhere.
Yes, cleaning the track and the locomotive pickup rollers and wheels is the first step in troubleshooting. After that, it’s a matter of checking the wiring and boards to look for obvious flaws. Hopefully, that takes care of the problem, because from there the troubleshooting becomes more complex.