I have many Lionel TMCC steamers - no Legacy - and there are no batteries in any
of them. Batteries are for conventional operation, if anything.
The problem you describe is almost unheard of with my locos, and occurs on only
2 of them - both old, early RS equipment. One must be shut down to get the sound
working (unacceptable), and the other can be simply given a command (like whistle). All the others, when hitting the rare "dead spot" come right back on as they should when
current flows again.
My 2 cents:
This sound drop-out that persists is a design/manufacturing flaw, and should not be
overlooked or accepted. If your loco is doing this there is something wrong with it.
A battery - which command does not need - is not a fix, even if it is a band-aid.
I tried it in one of the two locos and it improved nothing.
This dead-sound-issue should not happen; power should restore it forthwith.