One way that this scenario could work IMO is if we ditch political centralization that encompasses Greater Germany and the other Magyar lands, and instead we assume that a liberal Habsburg Emperor and the Frankfurt Parliament work together to create a federal liberal Greater Germany that is in personal union with a liberal Kingdom of Hungary and Croatia. Basically an Ausgleich on steroids. IIRC the 1849 constitution had provisions to this regard if Austria had decided to join the Reich. If the Habsburg Emperor is willing to give up centralization of his lands and work out the personal union with German and Magyar liberals, everything shall fall into place. The settlement may have a few minor wrinkles (German nationalists shall adamantly refuse a personal-union status to Bohemia-Moravia, and insist that it becomes an integral part of Germany, if with federal autonomy, both for historical reason and to safeguard the status of Germans in B-M; likewise it is questionable whether Magyar nationalists shall be willing to allow a personal-union status to Croatia, or it shall insist that it stays a part of the Kingdom of Hungary, if with some federal autonomy; it is quite possible that some quick cohercion of czechs and Croats be necessary to complete the settlement, but if Austria, Prussia, and German-Magyar liberals are working together, it is easily done). In this scenario, the romantic legitimist mindset of the Prussian King, which ruined things OTL, shall work to Germany's advantage. If the Habsburg Emperor takes the lead of German unification, he shall feel compelled to follow, even if it places Prussia subordinate to Austria.
One important thing, in this scenario, what happens to Italy. This mega-unification cannot leave it dangling. There are only two possible good plausible settlements to it IMO: A) pulling on the immense power and prestige that the unification is going to give him, the Emperor steps forward and offers other Italian princes a national federal unification on the German model, with himself as King-President of the Italian Confederation. With a liberal Emperor, Italian liberal nationalists would most likely accept the deal and strongarm the princes into accepting it. B) The Emperor declares that with the unification of Germany-Hungary, his responsbilities outside Italy are too compelling, makes peace with Savoy and cedes it Lombardy-Veneto (maybe even Trento, too), in exchange for an alliance treaty and customs union. Savoy uses prestige from this and help from italian liberals to strongarm the other Italian princes into setting the federal Kingdom of Italy, on the German model, as above.
Notice that if these scenarioes transpire this way, neither Britain nor France nor Russia shall have anything close to a decet casus belli, notwtihstading how much impressive Germany-Hungary or Germany-Hungary-Italy looks on the map of Europe. In this scenario, both from a liberal and a legitimist POV, everything is happening according to the (more or less) free choices of the legitimate authorities, the princes and the peoples involved, not by military conquest, so there is no good justification for other great powers to intervene. The "balance of power" is not a good justification alone for a casus belli, certainly not for the British Parliament, nor for a 1848 France in the midst of its own liberal revolution (which by the way shall be powerless to do any military adventures up to mid-1849). Even legitimist Russia would be embarassed to attack. Oh no doubt that in the following years France shall be scrounging to find a decent casus belli, and to appease Russia the Emperor may have to cede Galicia and sign Russia a basic blank check for expansion in the Balkans, so you can expect an early WWI between this Triple Alliance in one state (or two) and at least France and/or Russia within the next two decades, but there is no reason why there other great powers should feel free to attack as soon as the unification is proclaimed.