The Manchus ruled over China for almost 300 years (1644-1912) while the Mongols ruled China for less than 100 years (1271-1368).
There is no definite answer to this question and a lot of factors were in play that probably all contributed to the rapid collapse of the Yuan. While the traditional view has long been that the Manchus were much more Sinicized than the Mongols and thus were able to rule much longer, this has been challenged in recent years by the New Qing History school, who questions the degree of Manchu Sinicization.
What we can say is that the Manchus were certainly much better at manipulating their subjects to appear Sinicized. Khubilai made it plain that he did not want to fully Sinicize - he was willing to Sinicize only to the extent that it would benefit him. Thus, the administrative framework that he established preserved a lot of of traditional steppe institutions. These included the granting of appanages to princes, annual rewards for members of the imperial family and Mongol aristocracy, the staffing of high government offices with Mongols and Central Asians, and the use of different scripts for official documents. The Chinese scholar Yao Dali has posited the view that Khubilai employed both Chinese and Mongol/Central Asian political institutions because he wanted to appease both sides and also have them serve as a check on one another. But the balance was kept through Khubilai's personal power and prestige, which his successors lacked. The Yuan after Khubilai was a constant battle between Confucian-influenced emperors/officials and the conservative Mongolian faction.
The preservation of steppe institutions also severely affected the issue of succession. As Joseph Fletcher noted, Mongol succession was a "bloody tanistry", and this was compounded by the fact that regional princes had control of military garrisons and Mongol aristocrats had control of imperial guards. The Yuan changed emperors 8 times in 30 years, each Mongol emperor reigned for an average of only 9.8 years (from 1260-1368). Civil wars and assassinations were quite common - Emperor Yingzong, perhaps the most "Chinese" of any Yuan emperor, was assassinated by conservative Mongols nobles who were disillusioned by his reforms.
There was also the issue of weather - the late Yuan suffered from frequent natural disasters and famines that contributed to local social instability. Yet John Dardess has noted that the late Yuan was turning increasingly Confucian - court battles were no longer between Chinese and conservative factions, but between different Confucian factions. The Yuan also did not lack popular support, many literati rose to the Yuan's defence and gathered militias when the Red Turban Revolt broke out precisely because the court was becoming Confucian. In fact, Toghto was on the verge of suppressing the rebellion when he was suddenly recalled and banished. Whether or not the Yuan could have survived had Toghto won is uncertain, but his dismissal certainly ended the Yuan's final hope of crushing the peasant rebellions. After his departure, his vast army evaporated and many joined the rebels, breathing in new life to the movement. The local literati who supported the Yuan switched their support to the rebel leaders, as they became disillusioned with the Yuan court.
Unlike the Yuan, which had to build up a bureaucracy from scratch, the Qing simply inherited the Ming fiscal and administrative system. The Qing built their state upon the foundations of the Ming, thus appearing legitimate in the eyes of the Han Chinese. Nor was the Qing as discriminative. Although it certainly favored Manchus, there was no four tiered social classes and the ethnic composition of the upper levels of government was much more balanced. The primarily method of selecting officials in the Qing came from the civil service exams (the exam was not held for most of the Yuan and the Yuan exam was heavily in favor of Mongols), so it did not disenfranchise the Han majority. Much more importantly, the Qing managed to establish a succession system that avoided the bloodshed and violence that befell the Yuan. From the onset, the Qing emperors ruled based on Confucian principles and employed Chinese institutions rather than steppe ways, and ultimately the Qing political apparatus was much more sustainable than the Yuan's.
The Yuan might have gone the same direction had Toghto put down the Red Turban Rebellion, but that is all just idle speculation. A combination of different factors, some of which the Yuan had no control over, ultimately killed it.