That is a good question.
Perhaps the context in the original Hebrew is a little different. Daniel 12:1 is applicable only to the righteous descendants of Israel, whereas Daniel 12:2-3 is a reference to the many nations and their people who will be blessed through the Israelite nation. Of the many Gentiles who sleep in the dust of the earth, some will be raised up to everlasting life, while the rest will experience shame and everlasting horrors.
It is just a thought on my part.
Daniel was speaking of the last day resurrection and final judgement of all, John 5:28-29 and Revelation 20:11-15 are parallel readings of this same event
You will closely note the book of life has been opened, this is the final judgement
Same Event Of Tge Last Day Resurrection And Final Judgement
Daniel 12:1-2KJV
1 And at that time shall Michael stand up, the great prince which standeth for the children of thy people: and there shall be a time of trouble, such as never was since there was a nation even to that same time: and at that time thy people shall be delivered,
every one that shall be found written in the book.
2 And many of them that sleep in the dust of the earth shall awake, some to everlasting life, and some to shame and everlasting contempt.
John 5:28-29KJV
28 Marvel not at this: for the hour is coming, in the which all that are in the graves shall hear his voice,
29 And shall come forth; they that have done good, unto the resurrection of life; and they that have done evil, unto the resurrection of damnation.
Revelation 20:11-15KJV
11 And I saw a great white throne, and him that sat on it, from whose face the earth and the heaven fled away; and there was found no place for them.
12 And I saw the dead, small and great, stand before God; and the books were opened: and another book was opened, which is the book of life: and the dead were judged out of those things which were written in the books, according to their works.
13 And the sea gave up the dead which were in it; and death and hell delivered up the dead which were in them: and they were judged every man according to their works.
14 And death and hell were cast into the lake of fire. This is the second death.
15 And whosoever was not found written in the book of life was cast into the lake of fire.