I'm not sure what Prussia would have done if Austria was on the brink of collapse, none of Monarchies wanted republican nationalist revolts to break out.
This is not 1848 anymore, and even then, the republicans were typically not the strongest faction. In the 1860s, the unifications of Germany and Hungary are happening under the helm of nice, safe, liberal-conservative Hohenzollern and Savoia monarchies. The Magyars magnates do not have any special republican sympathies, they may be expected to pick a king if Hungary breaks away, almost surely on their own initiative and certainly if the great powers tell them to.
If the Habsburg empire does collapse, you may surely expect it to be partitioned between Hohenzollern Greater Germany, Savoia Italy, Tsarist Russia, and the Kingdom of Hungary-Croatia.
Cant be sure also that France or Russia wouldnt intervene to prop up Austria.
Russia would not intervene to prop up Austria, it did it in 1849 and as a reward Austria embraced anti-Russian armed neutrality in the Crimean War, they are not going to do it again. If anything it would grab a piece in the partition with the other neighbor powers, and rejoice that it has lost its main rival for domination of the Balkans. France would, but in this scenario Napoleon III has been caught with the pants down, with no military preparations and the wrong diplomatic platform: he expected a limited Prussian-Italian victory that would allow him to play the umpire. He may be expected to make an hasty swing to a pro-Austrian stance and make diplomatic pressure on the victorious allies to rein in their extreme demands (Czechia, Trieste) but no more. Bismarck and the Italian government are going to heed it, since they'd rather not risk a two-front war with most of their forces deep within Austria, even if it's collapsing.
Prussia and Italy would still make much more gains than OTL (Saxony, Austrian Silesia, and Sudetenland; Trento and Gorizia-Gradisca). The shock of a double total defeat is most likely going to send Austria on a death spiral to domestic collapse in a few years, even if the peace allows them to temporarily pull the empire together. The Hungarians would make harsher demands than OTL, there would be a massive upsurge of Pan-German sentiment in German Austria, the Croats and Czechs would be more uncooperative, the few remaining Italians even more rebellious.
As it concerns France, Napoleon's pro-Austrian diplomatic intervention would win him no friends in Berlin or Florence. The Italo-Prussian alliance would get reaffirmed and emboldened, in a few years France shall face several issues of contention with it where Napoleon III cannot afford to compromise (Luxemburg, Rome, the Spanish Succession), usher in the Franco-Prussian/Italian War, and the rest is alt-history.