If the Afghans of today are indeed those of the black flags, they'll have taken out Pakistan's Army (or converted it) before the Mahdi ever arrives. The hadith only mention wars between the Mahdi and the Arabs (first the Saudis and other Gulf Arabs I presume, but there's specific mention of an army from Syria that gets swallowed up by the ground outside Madinah).