Vanitas was isn't tied to Ventus waking up he's his own person. As Ven said he was going to destroy Vanitas, which would destroy the X-blade, and that in turn would heavily damage and all but destroy the hearts that make it aka Ven and Vanitas. He did exactly that and that's exactly what happened and we watched Vanitas's heart vanish and then Ven's heart do the same. Ventus found himself in some weird black void but was lead out of it and into Sora's heart by their connection. Vanitas had another person filling in part of his heart like Ventus, except it was Xehanort instead of Sora and so it stands to reason just as Sora could reach Ventus that Xehanort would be able to call Vanitas back from the void.
Sora only saw Vanitas for a split second because of Ventus. Specifically Vanitas was with YX but lacks a physical form so he couldn't be seen however his heart resonated with Ven's heart and made him visible for a few seconds. It's the same way Roxas and Namine can see one another when Sora and Kairi are together or like when Sora saw Kairi at Merlin's. We/Sora were seeing what Ventus was seeing but only for a moment, enough for Sora's eyes to glance over to the side and then for Vanitas to be gone. It's one of the effects of Ventus's heart having recovered fully and finally awakened.