If no soul may see God unless it has been totally purified (Purgatory), and since Purgatory ends on the Day of Judgment, what happens to the souls of the people who are still alive on Judgment Day? How are their souls purified?
This level of detail is not supplied to us by the biblical texts. Nor are such details defined in the magisterial teachings of the Church. Hence, we are in the realm of speculative theology when it comes to such matters.
We ought to begin by saying that the Day of Judgment will not be a day like any other. There are many unknown factors, especially related to the mystery of time, that underlie our speculations. For example, is Judgment Day really a day of 24 hours? Or is it a moment in time that happens like a flash? Perhaps it is a longer period of some indeterminate length? Does time even exist, as we know it now, at a moment like that?
There is also a premise in your question, which is not unassailable. Namely, that Purgatory ends on the Day of Judgment. We do not know this. Perhaps Purgatory, or the process of purgation, may exist for a time after the last judgment. But here too is another question. What does it mean to say that something exists “for a time,” if time as we know it no longer exists?
Perhaps the best we can do with a question like this is to say that it is not for us to know such details, and that God will accomplish the purifications and purgation necessary in ways known to Him.
It would certainly seem that such purification would in fact be necessary based on Scripture, which says of heaven, Nothing impure will ever enter it (Rev 21:27). And thus, while Purgatory, or the process of purgation, is set forth in Scripture for us who die now, how God will accomplish this for souls in the rarefied conditions of the Great Second Coming is known to Him, but not revealed to us with enough specificity to answer your question without speculation.
"Building our Catholic faith one question at a time."