If this is for personal experimentation purposes, try using Estes model rocket ignitors. They are used with batteries to ignite black powder rocket motors all the time. They would easily ignite a charge in a muzzleloader type firearm.
For commercial applications, electronic ignition is almost certainly the future -- but it's not here yet. Yes, electric ignitors have been done in the past, but it wouldn't be the first time an invention was "ahead of its time."
There is nothing wrong with the reliability of batteries. They're chemical devices that are no less inherently reliable than primers or the metal springs that we depend on today. With N+1, it's easy to have redundancy as well. Batteries and electronics are easily waterproofed and they work in cold environments like outer space all the time.
The chief reason electronic ignition is superior to the moustraps we have today is because ignition can be initiated without any mechanical demand. The trigger pull weight, pull length, take-up, smoothness, gritiness, wall, feel, stacking, and the location of the trigger relative to the bore center all contribute substantially to the gun's shootability. That's the reason we have so many types of "actions." Everyone is trying to invent a better mousetrap. With electronic ignition, the trigger is mechanically disconnected from the mechanism that fires the gun. It's fly by wire. It does not have to cock the striker or mainspring. It could be better than the best single-action trigger we have now, and yet it wouldn't require pre-cocking the hammer or manipulating the safety. Why not?
That brings us to the second advantage: electronic control of ignition means computer control. If it's not your finger on the trigger, but clothing or a piece of the holster, no fire. If it's someone else's finger, no fire. Of course this could also mean that if GPS indicates you're in a "gun free zone," it could be remotely disabled. There's lots of other implications to remote control, but I won't get into all of them because they're all hypothetical "what ifs." But how about this one: Your eye focuses on a target. You move the gun up and press the fire button. When the bore is aligned to the target your eye is looking at, then the gun fires. You could adjust it to 1 MOA to hit bullseyes at long range, or to fire when anywhere within 80 MOA for the fastest shot on a man-size target at 7 yards.