right, she just remembers her name like that... Out of nowhere. Yup...
Ah yes..... another Type-Moon bingo card "MC Plot Armor" is checked.
If Illya is rewritten by the world that she never exists. So who insert memory about Illya to Beatrice and suddenly everyone remembers her ? Is it because of 2nd magic interference ?
I mean, at least you can say there was some sort of foreshadowing as it was mentioned during Illya's fight with Beatrice that her memory leaks out in the form of the thunder she releases in the sky (also the reason why Illya and the readers were able to see Beatrice's backstory with Julian), so it makes some sense that the if the thunder comes back to her, some memory also comes back.
As of how convincing this is (I don't think it's as obvious as Shirou handing Kuro the origin bullet), and whether this was Hiroyama's original intention when he thought about how everybody would remember Illya, or did he envision a slower development, that would be somewhat debatable.
(PS: As of "MC Plot Armor"... There seems to have been an unwritten convention in the world of visual novels that the protagonist shall not die, which I absolutely hate, but I guess this was just how it was, unfortunately.)