But that's not realistic in itself, the Japanese knew they were going to be fighting the Americans sooner or later. They chose to do it sooner, in the hope they could knock the Americans out on their terms.
The Japanese also hit the U.S. while they had a reasonable chance of success. They had read the Two Oceans Navy Act and were able to do the math as far as the changes coming.
As an example between 1921 and the end of WW II the Japanese commissioned two battleships (granted they were BIG BB) and had a third under construction prior to converting it to a utility carrier design. The U.S. commissioned
four South Dakota class BB between March 20 and August 16, 1942, having commissioned two BB in March-April 1941, and had eleven more fast BB ordered for delivery between March of 1943 and March of 1946 (six I
owa and five
Montana class). That would have been a 17:3 ratio. Carriers were worse, while cruiser and destroyers building plans were simply overwhelming.
The Japanese had a very narrow window of opportunity and they chose, very poorly, to take advantage of it.
To the OP: The Japanese had no choice but to attack Pearl Harbor. The U.S., particularly the U.S. Pacific Fleet, presented an existential threat once Japan chose to attack South into the DEI. Military planning requires threat assessment. Once a threat is determined it has to be honored, i.e. taken out of the scenario either by diplomatic means or military action. The Japanese could not leave the Philippines, with its major U.S. air and naval bases, in hostile hands if the resources from the DEI and SEA were to be transported to Japan. American B-17s from the Philippines could interdict all of the South China Sea AND threaten Japanese bases on Formosa. American bases on Guam could threaten the Japanese position on Saipan (which was a LoN Mandate to Japan but one that the Japanese fully intended to retain permanently) while Wake, which was being developed into a B-17 capable base, provided a perfect location to attack Japanese positions in the Marshalls (another Lon Mandate that Japan considered to their permanent territory).