Majora's mask didn't use an internal battery to save, but a 29L1100KC-15B0 chip, which is a flash memory chip. Ocarina of Time, if you open it, you'll see a battery much like a Tamagotchi CR2032 coin battery, which can be replaced. So MM is different. Only a handful of N64 games used a flash memory chip, as they were costly & more expensive to produce. Unfortunately MM is one of those, along with some like Paper Mario. If your chip has truly gone bad, not much you can do about it. I would look online & see if there's ways to replace the flash chip, but it's not looking good.
Also keep in mind that repro (fake) cartridges use batteries, so if your cart isn't official, that may be a possible fix. However you won't know without opening it, so if you have the skills/tools for that, maybe look into Reddit for photos for that & what you may be dealing with.