The losses the USN incured during pearl harbor was like 2 sunk battleships, and 6 battleships that got damaged, repaired and rejoined the fleet after. And like 3 cruisers sunk cruisers and destroyers.
Couple of points you're missing: the actual total was more like 6 sunk battleships and 2 damaged. The fact they could be raised and repaired by the US doesn't necessarily follow for the British, which is rather the point. In fact it's doubtful they they could have even repaired the badly damaged ships. The industrial capacity isn't there in combination with their wartime efforts to address the U-boat threat and maintain the rest of their fleet at combat readiness.
The UK had actually built beyond the ability of its industry to maintain a fleet in wartime conditions. Witness the fate of the majority of the RN's heavy ships, as they start getting laid up circa 1943 due to their increasingly poor condition. If they take major damage in combat, no solution is going to be forthcoming.
If the RN suffered the exact same losses during their fictional pearl harbor attack, as the USN suffered, they would still have so many ships left. It might have affected their naval battles against the Regia Marina for a bit and they might have needed to redraw some ships from the pacific for a while, but it ultimately wouldn't have affected the outcome of the war by a lot.
It would have broken them. You're ignoring quality for numbers. The RN barely had enough ships available to meet all its missions. It had to maintain a defensive posture in the Indian Ocean, have enough force to counter the Italians, and maintain enough ships at Scapa Flow to counter German raiding. While on the surface their panic about
Bismarck seems strange given how badly the RN outnumbered her, examined more closely it becomes clear that the RN realistically only had seven battleships which had any business being in a fight with a modern fast battleship such as
Bismarck or the Littorios:
Hood,
Nelson,
Rodney, and the four KGVs. With the loss of
Hood and
Prince of Wales preordained, that turns it down to five. With this they have to guard against
Tirpitz, what they think are four Littorio-class ships, and the possibility of the Vichy French stirring from their ports with at least one fast battleship of their own, plus the two Dunkerques which will be difficult to effectively counter without a fast battleship.
Older battleships are still of use, but it must be expected they will have to both counter the older battleships of the enemy and be present in at least two-to-one numbers to counter fast battleships; not so much because they are at a disadvantage in a one-to-one fight, but because they must be in the right place at the right time and so operationally more of them need to be deployed to intercept the enemy rather than allow them to slip by. After doing the math, it becomes obvious the British do not have quite enough ships. And this is all to merely hold the enemy at bay; the chances of winning any individual engagement are up in the air and a few runs of bad luck could make things even less appealing.
The mob of old battleships that held the Italians at bay is now greatly reduced, and the Italians have reason to be more bold knowing that defeating this set of enemies will actually matter. The threat of British naval power which along with American diplomacy held the Vichy French to lukewarm alliance at best with Germany is gone, with unpredictable results. The British cannot turn to their carrier arm for answers either; their carriers do not have the modern aircraft, the doctrine, or just the numbers (despite their apparently high number of ships, each individual British ship carries fewer planes than American or Japanese ones do) to fight major fleet battles.
If everything worked out as the Japanese had hoped (destruction of a few carriers at pearl, a decisive fleet battle at midway), they definitely had a chance of 'winning'. Ergo, make a favorable peace treaty with the USA while they held naval superiority over the pacific.
They were fully aware they had not a snowballs chance in hell if they let the US get to buildin'.
The Vinson Bill was passed when Japan refused to join the Second London Naval conference in 1936, the Two-Ocean Navy Act in 1939. The ships that would destroy Japan were, very literally,
already building by the time the bombs fell on Pearl Harbor.
Combine that with the fundamental logistic inability of the Japanese to seize Hawaii or mount effective attacks against the West Coast, much less the East Coast where most of the major warship construction yards are, and there is no win condition.