The Yamato was sunk by a fleet of carriers, a very large fleet of carriers, and had a tiny fleet with it. That is more an example of uneven forces than mismatched forces. Carriers are not invulnerable, even when fighting from outside of enemy range, they require aircraft to do so, aircraft can be damaged or destroyed. A depleted carrier may be cheaper to restore than a damaged-or-destroyed battleship, but it is a cost none-the-less and the ship is still out-of-action... Add to that the higher running costs(I am assuming here) and battleships start to look more favourable, provided that they do not sink.
It seems to me that there is still a role for a battleship, just not one of dominance. A ship with, say, 4 three-hundred-and-sixty millimetre guns, spread over two turrets, could still discourage smaller ships from approaching even though it would not be suited to defeating a battleship in a duel, while hosting far more antiaircraft fire(or facilities to increase its agility...), including shrapnel rounds from its main guns that could outrange anything the aircraft could do, although would likely do little more than disrupt formations and flight-paths... Meanwhile it could wear the same armour that takes dozens of direct hits from aircraft to overcome while mounted on the least-desirable location for aircraft to approach. a particularly ambitious designer might even try to add some sort of docking facilities for extremely light craft that could sortie with sonar against submarines while this 'escort battleship' provides resupply and poor-weather protection that would normally render such light vessels impractical in open seas...
Note also that our carriers are light, only, what, 20 aircraft? I would not expect them to defeat an unescorted battleship one-on-one, and the sort of fleets that were being hurled around the pacific could probably withstand a dozen of them with negligible losses. Which exposes another flaw of the carrier. If a carrier is overwhelmed, it is pretty much useless. While the sip itself is almost defenceless, its aircraft are prone to being overwhelmed too. If five fighters and five torpedo-planes encounter 10 fighters, then they are very unlikely to so much as scratch an enemy ship. The great carrier victories tend to rely upon enough forces to effectively keep their opponent busy, at least temporarily. If the enemy can field twice as many fighters in defence as you can when attacking, than you are basically irrelevant, while a battleship can still pose a threat and force a response if it advances on something sensitive.
Carriers are definitely good, no mistake, but it seems foolish to ignore a combined-arms approach, and a battleship carriers a lot of stopping-power and hard-point that carriers are largely bereft of.