"Safe" is not a very good name
I have both. Two of each. Neither of my electronics have a key backup. I have seen that key backup easily picked by "experts" as in expert at using Google and coming prepared with just a LITTLE bit of practice. Tools and knowledge available online in places most of us don't even realize exists on the internet.
The big long key and keyhole greatly reduce the security if your thief is more than your typical "smash and grab for drug money" kind of thief. Luckily that ilk is 98% of the break-ins. But for someone who knows what is in there and targets it, and knows a little about locks, the key lock behind the keypad is an easy mark. That is why the mfg's attempt to hide it.
The CPU part of electronic locks is internal. The only thing external is a dumb keypad. If the keypad is broken or damaged by the aforementioned smasher and grabber, a new keypad can be attached and the old combination works.... assuming you have the wires accessible.
I use only top quality batteries, and I change them once a year. They typically test at about 80% when I remove them. I set a calendar entry on my phone and computer to remind me when, and I write the date installed on the battery before I put it in. Treat it like you should be treating your red dot optic batteries.
Both of mine are S&G electronics and the mfg STRESSES not to use cheap batteries that gradually drop voltage early as they age. They usually have recommendations on batteries on their website. Nothing fancy, just 9v batteries. Just not off brand, low cost like you buy at Christmas for the kids toys.
I have not had any issues with any other than my OLDEST small mechanical dial type which after about 35 years started getting hard to turn. Fixed with a spray of very light lubricant.
I'm not saying they are problem free, but neither are the old mechanical locks.
I will say that some of the electronic locks on some of the lower cost safes (which typically have a keyhole under them) seem to have a much higher rate of issues.
Having said all that... if I were looking for a $400 to maybe $1000 safe (in this part of the country) and really only worried about fire and Mr Smash and Grab, I would probably prefer a mechanical as well. They are harder to find because the cheap electronic units are cheaper for the mfg, and the mfg addressed the concern about reliability by giving you (and the motivated thief) a KEYHOLE to attack!
One thing to keep in mind. If you've got something a pro wants.... with proper motivation and time, you will NOT stop him, so the $5k safes give you space, but not absolute security. On the other hand, the low end, external hinge, live bolts on one side only with nothing on top or bottom, cheap lock, keyhole equipped, budget safe will ONLY stop the typical smasher and grabber.
Personally I think the sweet spot exists somewhere in the middle from most safe manufacturers.
With my own eyes, twice now, I have seen a man with one extension cord, two power tools from Walmart, and just under 5 minutes, open those like a tin can. But then, he was neither high nor hurtin' or it might have taken him 7 or 8 minutes.
Just my $.02