Presumably you were resuscitated before the electrical activity in your brain stopped? My understanding is that's how we define brain death, as the cessation of electrical activity in the brain.
You have a point. Medically induced coma such as with pentobarbital can “flatline” the brain, eliminating electrical fields. After weaning the pentobarbital patients have their memories intact.