I will attempt to answer, with help from mAnUkya upanishad. English language, being the most simplistic in grammar, has and uses only 1 word to describe Atma. That 1 word being soul. However, according to vEdAnta, there are several types of Atma. Per mAndUkya upanishad verse ii, Atma is of chatush pAda or of 4 quarters, which are -
- vaiswAnara Atma = This Atma governs your body when you are in the awake state of being, such as between when you get up from bed in morning till you sleep at night. Into this Atma our mind is sucked into and retained until we go to sleep.
- taijasa Atma = This Atma governs our body when we are dreaming state during our sleep. When you are asleep at night, and are dreaming, it is this Atma that is 'living' in the body. Into this Atma our mind is sucked into and retained until we move from dreaming state to non-dreaming state in our sleep.
- pragnyAna Atma = This Atma governs our body when we are in the REM sleep stage during our sleep. That is the state when we are asleep but are not dreaming yet we are breathing and alive. Into this Atma our mind is sucked into and retained until we wake up from sleep. This 'is the lord of all; this is omniscient; this is the in-dwelling
controller (of all); this is the source and indeed the origin and dissolution of all beings.' claims verse 6 of mAndUkya upanishad. Therefore, it can be emphasized that so long as this pragnyAna Atma exists, the body is alive or made to live, otherwise the body cannot live or be made alive.
Verse 7 then goes into the 'turiya' state of the Atma, or the 4th pada the 4th quarter of Atma, but for the purpose of this answer, going into it in detail is not necessary and it will suffice to explain what it is by simply stating that it is neither conscious nor unconscious, it exists within us as well as outside us.
Based on above verses of mAndUkya upanishad, it is clear that a body can still be medically alive even if one or all 2 of the above non-turiya Atmas are gone, so long as the pragnyAna Atma is still present, even if it is just a flicker, in the body. Think of it, when someone is 'brain-dead' and is in a vegetative state, it is because that person's 'vaiswAnara Atma' is gone, but other Atmas are still existing in it. So the person is alive, but 'brain-dead' (don't confuse with vaiswAnara Agni, which is needed for digestion). Likewise, if the person is alive but suffering from medical insomnia and cannot sleep at all, his taijasa Atma is gone, but other Atmas are still existing in the body. In the same way, when a person experiences OOBO ('outer body experience' or 'out of body experience'), then it is the 'taijasa' Atma that leaves the body, experiences whatever and comes back to it, because the pragnyAna Atma never left the body.
Medically speaking, researchers currently believe that all the medical functions associated with the vaiswAnara Atma, the taijasa Atma and the pragnyAna Atma as explained by above mentioned verses in the mAndUkya upanishad are handled and generated by the 'Pons' part of the Medulla Oblongata and Cerebellum parts of our brain.
Current research says that in the immediate few minutes after death, the brain is still alive for 3 to 5 minutes after the heart stops breathing. In this study, researches concludes that "it could be possible to reboot the brain for as long as three to five minutes after a human heart stops beating or ceases to show signs of life." This clearly indicates that the Pons part of our brain (which underlies the vaiswAnara, taijasa and pragnyAna Atmas of the upanishad) may still be alive and susceptible to rejuvenation until 3 to 5 minutes after death.
How to rejuvenate this Pons part of brain? No one knows how. Remember the emphasis made above from mAndUkya upanishad that so long as the pragnyAna Atma exists, the body is alive or made to live, otherwise the body cannot live or be made alive. So, could the answer to the above question of how to rejuvenate the body within 3 to 5 minutes of death lie in understanding how to control and operate the pragnyAna Atma within the body? Perhaps our ancients and demi-gods knew that by preventing the pragnyAna Atma from leaving the body and kick-starting the vaiswAna and taijasa Atmas (Pons part of brain), one could rejuvenate a dead body. I think that is very probable.