How can the Hour come upon the worst of people when the Trumpet blast will come when people are dead?
Question

How can it be that the Hour will come upon the worst of people when the Trumpet blast will come when all people will be dead?
Praise be to Allah.It is narrated that the Hour will only come upon the worst of people.
Imam Muslim (148) narrated from Anas that the Messenger of Allah (blessings and peace of Allah be upon him) said: “The Hour will not begin until it is no longer said on earth, ‘Allah, Allah.’”
And the souls of the believers will be taken when the Hour is approaching.
Imam Muslim (2940) narrated that ‘Abdullah ibn ‘Amr said: The Messenger of Allah (blessings and peace of Allah be upon him) said: “The Dajjal will appear among my ummah and he will stay for forty. I do not know if it is forty days, or forty months, or forty years. Then Allah will send ‘Isa ibn Maryam, who looks like ‘Urwah ibn Mas‘ud, and he will pursue him [the Dajjal] and kill him. Then the people will remain for seven years with no enmity between any two people. Then Allah will send a cool wind from the direction of Syria and there will be no one left on the face of the earth in whose heart there is an atom’s weight of goodness or faith but it will cause him to die. Even if one of you were to enter the heart of a mountain, it would enter and cause him to die.” He said: I heard it from the Messenger of Allah (blessings and peace of Allah be upon him), who said: “There will be left the most evil of people who will be as swift as birds and be as vicious as wild animals. They will not acknowledge any good or denounce any evil. Then the Shaytan will appear to them and will say: Will you not listen to me? They will say: What do you command us to do? So he will command them to worship idols, but despite that they will have ample provision and a good life. Then the Trumpet will be blown and no one will hear it but he will tilt his head to one side. The first one to hear it will be a man who is fixing the trough for his camels. He will swoon and all the people will swoon. …  
With regard to the Trumpet blast which will signal the resurrection, it will come when all the people are dead, then they will all be resurrected, believers and disbelievers alike. This is what will happen at the second Trumpet blast, at which people will rise from their graves. As for the beginning of the Hour, the end of this world and the beginning of the next world, that will come at the first Trumpet blast, which is the one which will make all people swoon; they will be the most evil of people, the last of humanity who will still be alive at that time.
Allah, may He be exalted, says (interpretation and meaning):
{The Trumpet will be blown and all those who are in the heavens and on earth will swoon, except whomever Allah wills. Then it will be blown again, whereupon they will be standing, looking around} [Al-Zumar 39:68].
And Allah knows best.