Japan had a history of sucker-punching larger powers and getting a peace treaty immediately for various reasons. In the Russo-Japanese War Russia was too distracted by internal issues to stay in. In World War 1 Germany was, well obvious really.
They expected the same thing to happen based on their history, that the U.S. Would be unwilling to prosecute a war half a world away for islands no one had heard of. So basically, from their perspective the attacks DID make logical sense, far more than an invasion of the U.S. By Mexico ever could.
Particularly since the Mexican-American war was in living memory and it didn't go well for Mexico.