Title says it all. Why did the Japanese monarchy survive to the present but the Chinese monarchy fell?
So there is no single easy answer to this question, and the ideal person to answer it would be someone with proverbial fingers in both pies – I however am not such a person as my expertise in Japanese history is at best limited. However, hopefully I can offer an impression of why the end of the imperial state in China was really quite a nuanced affair under conditions very different from what Japan has faced.
It is worth mentioning that historiographically, the principal point of comparison for the rise and fall of the Qing has not been the Japanese imperial court, but rather the Edo bakufu (a.k.a. the Tokugawa Shogunate). Both were roughly contemporaneous, and lasted about as long as each other – the Qing Empire from 1636 to 1912 (276 years), the Edo bakufu from 1603 to 1868 (265 years). In fact, both China and Japan saw the overthrow of a longstanding monarchical state less than 50 years apart – the difference was that in Japan, the old de facto monarch was deposed and the old de jure monarch given full nominal power, whereas in China, the monarchy was replaced with a republic. To put it another way, the major upheaval in China was the end of the imperial state, whereas that of Japan was its 'restoration'. Now, that being said, there was one subsequent occasion on which external events might have caused the end of the Japanese emperorship, that being at the end of the Second World War, though this falls even further outside my scope, and so you may want to check out the answers linked here by /u/jbdyer.
As for the fall of the Shogunate and the Meiji Restoration, I would strongly recommend checking out the linked answers written by /u/ParallelPain and /u/NientedeNada compiled in the relevant FAQ section. To sum up in brief here, what became the Meiji Restoration came about mainly due to growing discontent among a small handful of largely southern clans – principally Chōshū, Satsuma, and Tosa – with Tokugawa rule, exploiting the uncertainty and instability brought about in the immediate aftermath of Japan's 'opening' by Western maritime powers. The anti-Shogunate domains, ruled predominantly by the lower-status tōzama ('outsider') daimyō (that is, those who had not allied with the Tokugawa clan during their campaign against the Toyotomi), seized on the crisis brought about by foreign intrusion to rebuild their own power, and basically used support for the emperor as cover for their anti-Shogunate plots. After their victory in the Boshin War of 1868-9, the two main members of the anti-Tokugawa alliance, the domains of Satsuma and Chōshū, dominated the navy and army of the new Imperial state, respectively, and basically held power behind the scenes with the emperor as a front. To put it cynically, all other considerations aside, the main power-brokers of the Meiji-era state found the emperor more useful to them alive than dead.
In China, however, something which factored into the fall of the Qing which did not apply in the same way as Japan was the problem of nationalism. The Tokugawa clan and the Japanese imperial line were both incontrovertibly Japanese. The Qing, however, was quite strongly perceived as a foreign regime by the Han Chinese, particularly as the nineteenth century wore on. We could argue over whether this position was 'correct', but that would be beside the point – as far as Han Chinese people were concerned, the Qing state was ruled chiefly by, and for the benefit of, the Manchus, a group that was conceptualised in increasingly essentialist terms from at least the 1850s onwards. The Qing's ruling dynasts were Manchus of the Aisin Gioro clan; aristocratic titles, including the heritable 'iron cap' princedoms, were reserved for Manchus; the Qing's main corps of elite troops and trusted bureaucrats were the members of the Eight Banners, a Manchu-dominated institution subsidised by the Qing government; Manchus were favoured for promotion in government; Manchu retained status as a prestige and bureaucratic language down to at least 1905; and so on, and so on. The end of the Qing Empire and the rise of the Chinese Republic in 1911-12 was not, in principle, the simple replacement of a particular system of government, but arguably a sort of declaration of independence – one that also ended in the occupation of the polity from which independence was being declared, as well as staking claims to its other imperial holdings. For a tortured analogy, imagine if after Yorktown, the Americans sailed across the Atlantic to take over the British Isles, took over Canada, and asserted dominion over India for good measure.
The ways in which Han Chinese nationalists attempted to respond to Qing rule in 1850-1912 were quite varied, and not necessarily tied to any particular constitutional outlook. Some favoured the establishment of a Han Chinese monarchy: attempting to restore the Ming Empire was obviously wishful thinking but it was the nominal position of groups like the Triads; there was the Taiping Heavenly Kingdom in 1851-64 which positioned itself not only as Christian but also, crucially, as anti-Manchu; in 1903 Hong Quanfu, the nephew of the late Taiping Heavenly King, was approached by radicals in Hong Kong to lead an abortive anti-Manchu uprising in Canton. Some believed that the Aisin Gioro clan could be kept on the throne, so long as the rest of the formal infrastructure of minority rule (such as the Banner system and the principle of ethnic diarchy in the metropolitan bureaucracy) was dismantled: this came to a head in 1898 when radical constitutionalists under Kang Youwei collaborated with the Guangxu Emperor to attempt a range of sweeping reforms, only to be shut down by the Dowager Empress Cixi (for more on this, see this answer as well as those linked within). And finally, some believed that the ideal end goal was the establishment of a Han Chinese republic, though it was an open question as to whether or not this would encompass the Qing Empire's other imperial territories beyond China proper: the most substantial republican faction was led by Sun Yat-Sen, but in the event it was independent radical groups, mainly in the Yangtze basin, that were the critical actors in fomenting the 1911 Revolution.
The ultimate success of the republican outcome was not pre-ordained. The Han monarchist outcome was definitely crushed by 1903 with the failure of the 'Second Taiping', but the constitutionalists, increasingly dominated by Kang Youwei's protégé Liang Qichao, still supported the semi-deposed Guangxu Emperor from exile. Moreover, the Qing court itself had, in the wake of the Boxer Uprising, pivoted towards a constitutionalist direction – one that, however, still attempted to retain some modicum of Manchu status and privilege, while at least appearing to capitulate more power to the Han Chinese. Aside from the failure of the 1898 reforms, two linked events served to cause republicanism rather than constitutionalism to become the principal radical tendency, and to scupper the potential for a constitutionalist outcome on the imperial court's terms: the first was the death (probably by poisoning) of the Guangxu Emperor in 1908, which led to the installation of Cixi's favoured candidate, Pu Yi, on the throne as the Xuantong Emperor; the second was the regency of Zaifeng, Pu Yi's father (and Cixi's right-hand man during the last years of her life). Zaifeng was less-than-subtly committed to the cause of Manchu conservatism, and managed at almost every turn to tick of Han nationalists more and more – his support for foreign loans in railway construction was interpreted as distrust of the Han; ditto the slow progress of establishing the eventual National Assembly; most disastrously, in May 1911 he announced the formation of a Cabinet whose 13 members included seven imperial clansmen and two other Manchus, leaving only four Han Chinese. With the constitutionalists' favoured candidate being dead, and his successor's regent appearing firmly committed to minority rule, the outbreak of a revolt that would seek to supplant the Manchu monarchy with a Chinese republic was almost guaranteed.
As ever, it is easier to say why something happened than why it didn't, but the key difference to highlight between Japan and China was that in Japan, there was no need to grapple with the notion that the monarchy was of a foreign minority which upheld systems whereby that minority retained power. The republican revolution in China was one of several means to an end, that end being the conclusion of minority rule and the establishment of a Han-dominated state of one form or another. In that regard we can draw some degree of analogy to the imperial restoration in Japan, where the idea was not that the emperor would actually come to power, but rather that the nominal reassertion of imperial authority would strengthen the old rivals of the Shogunate – in other words, supporting the emperor was a means to an end, not the end in itself. To put it succinctly, in Japan, backing imperial rule was the solution to a problem. In China, imperial rule was in itself the problem.