MAJOR SPOILERS BELOW
This is the beginning of yet another aggravating mystery which probably won't be solved or resolved until official confirmation is released. To my knowledge the Hyrule Historia makes no mention of it. After all, Ghirahim was sucked into Demise's blade and then was no more. But what about after Demise fell in combat as well? He lay there, struggling to rise, grasping the hilt for support...and the sword just dematerialized into smoke and vanished. That one scene must've made thousands of fans raise an eyebrow, as it did me.
Notwithstanding, several possibilities exist:
1) Whenever Demise crumpled to the ground, he knew his end was near, so he sought to distract Link with warnings of what would come in the future while he actually purposed to transport his blade elsewhere, and before he was absorbed.
2. Ghirahim, still conscious in the "Anti-Master Sword," abandoned his master because it turned out he could be felled by a mere mortal.
3. Through a mental connection, Ghirahim and Demise collaborated that a personification of the latter's hatred would be aroused throughout coming generations. The blade would become his [Ganon's] once he happened upon it.
4. Ghirahim is unconscious in the sword, and is actually forever sleeping, just like Fi was, but his master transported it away anyhow for his reincarnation.
5. Finally, Nintendo simply wanted the weapon removed and saved for a later title, and they'd tie the actual events into the story of that, possibly bringing Ghirahim back, or at least showing some sentient thought emanate from the blade.
Again, I have no evidence to substantiate any of this, as we can only conjecture the factual occurrences therein. But we do know Ghirahim was vacuumed into the Anti-Master Sword, and that he could be lying dormant there. The real conundrum, though, comes from what became of the sword he's housed in...