To answer this question we need to look at a few things. Japan's experience with the fighting the USSR and its subsequent relation with them, geography and the state of the Japanese military.
Firstly, from 1932 to 1939 there had been a number of undeclared border conflicts between the Soviet Union and Imperial Japan in Northeast Asia. In 1931 Japan had invaded Chinese Manchuria and founded the puppet state of Manchukuo in the conquered territory. Manchukuo bordered the Soviet Union and the Mongolian Peoples Republic and it didn't take long for border violations and small clashes to occur.
In Japan there was a political doctrine called "Hokushin-ron" or "Northern Expansion Doctrine", which saw wide support under the Imperial Japanese Army. This doctrine saw Manchuria and Siberia as Japan's sphere of interest and an area of expansion for the Empire. Thus after the successful invasion of Manchuria the Japanese Imperial Army began making incursions over the Soviets and Mongolian border, which culminated into clashes and skirmishes. These conflicts happened every year from 1932 to 1939, without an official declaration of war from either side. In 1939 the Battles of Khalkhin Gol took place which ended in disaster for the Japanse Imperial Army, who not only took heavy losses but also initiated and escalated the conflict in Northeast Asia without authorisation from the Japanese government.
By now Japan had also joined the Anti-Comintern Pact with Nazi Germany, and the Nazis had made an Non-Aggression Pact with the Soviets. The Japanese were also fighting the Chinese in the Second Sino-Japanese War and could use more resources there. So the support of the government shifted to the "Nanshin-ron" or "Southern Expansion Doctrine" policy, which advocated for Japan to expand into Southeast Asia and the Pacific. in 1941 the Japanese would even make a Non-Aggression Pact with the Soviets, before Germany broke theirs and invaded.
So by the time Germany did invaded the USSR, the Japanese had already shifted gears and were planning to instead use the Imperial Japanese Navy to conquer the European colonies in Asia, which were now a lot less protected as the UK was still fighting the Germans and the French and Dutch had been defeated in Europe already. The Japanese saw the US Navy as their biggest contender in the Pacific and Southeast Asia.
Now if Japan had decided to instead join Germany in attacking the USSR, the oil shortage would not be solved quickly. The Caucasus are far, far away from the Russian Far East, and even if Germany had captured them, the Germans and Japanese would either need to control the entirety of the Trans-Siberian Railroad along with all the major Soviet cities which lay along it. Or they would need to ship the oil over the seas, which would mean that they'd need to control the Mediterranean and ship it from the Black Sea through the Suez Canal, which they'd also need to conquer. Or they'd need to bring it to Western Europe and ship it from there, either going around Africa or crossing the Atlantic, but Africa was dotted with colonies of the Allies and the Americas held Allied territories as well, even if the US wouldn't join them.
This would be a monstrous task for both the Germans and the Japanese, and just unrealistic in scope. It was much easier for the Japanese to take the Dutch East Indies, which were close to their already conquered territory, the Dutch were already defeated in Europe and it fitted the Japanese vision of the Greater East Asian Co-Prosperity Sphere, in which the Japanese liberated Asian peoples from their European colonisers.