I remember reading that the insistence of both Japan and Germany in building "the biggests weapons" were their downfalls.
The amount of engineering, manpower and resources needed to build one Yamato battleship, would have been enough to build up to 10 fast battleships.
Or how a single Schwerer Gustav Railway gun could have been used to build at least 100 heavy panzer tanks. Or a bunch of Panthers.
Not to mention multiple ultra big weapons that failed to be fulfilled (like the Ratte, Maus) which the wasted resources would have made them build hundreds of V2 bombs.
They said the only useful strike of these mega railway guns were hitting a few very strong ground based bunkers. (if the shell hit the place they intended to hit.. nothing survived. Taking down multiple forts and reinforced bases and storage centers).
Very familiar with the battleship Yamato and her sister ship Musashi, both of which were sunk by our carrier-based planes late in the war.
The German military in particular had always been obsessed with big guns. Everything from tanks to railway guns.
And yes, the Germans and Japanese spent huge amounts of resources to build certain "superior" weapons, but, we just simply out-produced them. "Arsenal of Democracy", and all. As just one example, for every Tiger tank the Germans could produce we could produce several Sherman tanks.
They also needed a lot of their resources from the territories and countries they conquered. The US, not so much.
Once those were taken back and the supply lines cut, things got worse and worse for both.
And, also, as I mentioned in my previous post, Strategic bombing took a huge toll, as well.
Even though bombing raids over Germany started in 1942, it took the island hopping campaign in the Pacific until late 1944 before we had captured islands close enough for B-29s to make round trip bombing runs (sans the carrier-based, and almost suicidal, Doolittle Raid in April 1942) over the Japanese mainland.
And, even though both of those countries built factories underground to protect them from the raids, it still just wasn't enough.
With supply lines cut, being relentlessly pounded from the sky both day and night, etc., who could produce anything after a certain point...?
It all just snowballed on them.
Here's an article about some of the last-ditch weapons the Germans had ideas for during WWII...
https://bearingarms.com/skaufman/2012/07/03/top-ten-strangest-nazi-last-ditch-designs/