Protip: once you dissolve as much of the gunk as possible, take a small metal brush and give the contacts a scrub. If they're coated, this helps open up metal contact surface to give the new batteries a chance.
But if the contacts are too corroded, you may need to MacGyver something with a soldering iron.
https://www.nytimes.com/wirecutter/guides/how-to-clean-battery-corrosion/