This was a popular war, driven partly by the popular desire to avenge the death of General Gordon at Khartoum. Popular with the people, the politicians wanted nothing to do with it. If you want to find out how the Brits did against the "Dervishes" (the ISIS of its time) you should look it up.
As you will know, but had to put in a little history here for others. The British did not wish to be cut off in the desert without water for their expedition. A railway was gradually built from Egypt to the Sudan. fanatics of Islam did not realise it's strategic value. It had water tankers and supplies easily transported.
Finally came the stand off. 20,000 crazed horsemen willing to die for Allah. The British lines at Omdurman holding with some Egyptian troops, plus the black Sudanese troops. On they came. The British had the Maxim, the Gatlin and the Gardner machine guns all American manufacture. About 11,000 horsemen died and never reached the bayonets of their enemy.
The Khalifa (Mahdist leader) retreated with his ministers and waited on his blanket for his doom. The Sudan went back to Egyptian control. Had those troops lost they would have been massacred to a man. Which happened to 10,000 Egyptian troops in the Sudan under Sir Michael Hicks in 1883. Two observers survived. They were Austrian. Finally escaped from Islam after many years.