Batteries are excluded for good reason. The device and battery can be a fire hazard. It needs to be capable of surviving high temperatures and pressures. The risk of any kind of electrical fault inside the recorder also needs to be exactly 0.
That's not all though. The boxes cannot actually get any data. The data needs to be sent to the black boxes from other sensors throughout the aircraft. So if the power to the blackbox is cut, it's likely that there is no power to the aircraft in general. That means there is no point in continuing to record. If we do include batteries, those batteries need to be able to power all relevant systems on the aircraft itself.
Also, technically flight recorders already have batteries. But those batteries are usually reserved for the locator beacons. Not recording. They are also located outside the black box itself. (although they are attached together and installed as one device.
It doesn't need to keep recording after a crash, and really, just a few seconds after the event that precipitated the crash is all that's necessary (I've watched every episode of Aviation Disasters).
Why? Once a plane completely loses power, especially modern planes, there's no saving it because there's no longer physical linkages between the controls and the control surfaces. FDRs also have a limited amount of storage, about 25 hours, so once it's crashed you want as much data from before the crash as possible not a few hours of zero because the sensors don't have power to send data back.