This is speaking most specifically of the second resurrection that will occur after Satan's period of temptation of men has been brought to an end. These people will come up in the second resurrection so that they will have their works judged.
He is showing that the judgment is going to span judgment of righteous works all the way to judgment of unrighteous works, and each will receive their blessing or cursing according to their works. It does not mean that they will receive it immediately, because we know from other places that they are going to be given an opportunity to hear the Gospel of the Kingdom of God and begin to show their faith in God and to produce the kind of works that they should have produced a great deal earlier.