The Barrier restrains Them, but It will be breached when the Hour draws nigh
Allah tells us that Ya'juj and Ma'juj could not climb over the barrier or penetrate its lower portion. Varying forms of the verb are used here in the Arabic text to reflect the difficulty of the action referred to.
(So they (Ya'juj and Ma'juj) could not scale it or dig through it.) This indicates that they could not penetrate it or dig through it. Imam Ahmad recorded that Zaynab bint Jahsh, the wife of the Prophet said, "The Prophet woke from sleep, and he was red in the face. He said,
As for the pronoun of the word: بَعْضَهُمْ (ba` dahum) in بَعْضَهُمْ يَوْمَئِذٍ يَمُوجُ فِي بَعْضٍ (And on that day, We will leave them [ Ya’ juj and Ma'juj ] surging over one another - 99), it is obvious that it reverts back to Ya'juj Ma juj. Then, as for their condition described therein - 'surging over one another' - it is also obvious that this will be their state when the passage lies open for them and they will be hastening their way from the hilly heights down to the ground. Commentators have suggested other probabilities as well.
The pronoun in: فَجَمَعْنَاهُمْ (fajama'nahum: Then We shall gather them together - 99) is reverting back to the creation at large, human beings and the Jinn. The sense is that the entire creation of human beings and the Jinn who have been obligated with the percepts of the Shari` ah (mukallaf) shall be gathered together on the plains of Resurrection (al-Hashr).
Tazkirul Quran
Maulana Wahiduddin KhanOn ayahs 98–100
The high ranges of the Caucasus in what is now Russian territory running between the Caspian Sea and the Black Sea, serve as a natural dividing wall between Europe and Asia. In this mountainous region there were certain passes through which the savage Gog and Magog (Yajuj and Majuj) tribes from the south used to enter the northern part of Iran and plunder it. Here, till today, there are signs of an ancient wall. There is every probability that this was the very wall which was constructed by Dhu’l-Qarnayn for security purposes. To erect an ‘Iron Wall’ to ward off enemies is a feat which generally generates a sense of pride in people. But even after constructing such an invincible wall, Dhu’l- Qarnayn did not lose his modesty and humility. He had set his eyes not on his own creations but on God’s mighty powers, and a human being’s power is nothing as compared to God’s might.
Uthmani text of the Madinah mushaf (King Fahd Complex). Translation: Saheeh International. Tafsir via Quran.com.