There are hypothetical questions and then there are some just silly ones.
To start with neither force had aspirations of globalization. And a single world superpower would not have been an option for either country. Japans dabble in ww2 was not through some clandestine attempt to dominate globally, but was due to US denying Japan's claim to the German concessions in Shantung, and FDR's unwitting halt on oil import to Japan and Japan occupied regions of china (along with other reasons). Japan struck out for oil from Holland occupied Indonesia, and the pacific fleet was all that stood in her way, thus was born the Great East Asian War (what the US called the pacific war)
But let’s assume you’re right and for some reason the two forces turned from each other. How might that go? Well prior to this hypothetical war, and post the end of allied-German aggression, we can assume that japans war party under Hideki Tojo would have finished the occupation of china, and taken the oil rich regions of Indonesia from the Dutch. They would probably occupy US bases in the Philippines, which may have served as a useful platform (or target)
Germany would occupy Russia along with its former USSR states; it would also be suffering from the same isolation from its Siberian arm the Russians still complain about today

. Germany (and maybe Italian, since your question makes no mention of Italy I ignore it for the most part) forces would have taken india, and most of africa through a collapse of Indian defended lybia and syria, and also taken the dutch south african colonies. Most of the middle east would also have fallen to germany including the oil fields of iraq which again were being defended by indian troops (i had to look it up but it was the Fifth Indian Division defending iraq during the early war). And the UK would of course be German as well, with hitler controlling the north sea oil and it rigs. That was the great thing about german occupation it left a relative great deal of infa structure in place (the blitz aside).
One big question is what about the US, who would occupy this vast area? German occupation of russia would require cooperation of russian authorities more so than any other nation, and it is questionable if they would have to resources to govern the US as well. But the same can be said for japan. But the US plays a role as to whether this war would see action in the deep east pacific. But other than occupation of the some western state platforms i can’t see the US providing any more than financial aspect. So let’s not get too bogged down with the US right now.
Japans main problems would have come from there newly acquired indonesia and its exposure to indian ocean. And given germanys sea based strength, matched only by the recently (and hypothetically) defeated British fleet, japan would suffer greatly at the hands of the germans. Syberia and mongolia would prove difficult to move large numbers of troops through for the germans and as such any attack on japan ocupied china would require movements through the ex soviet state of Kazakhstan. Whereas china would prefer to be fighting on its eastern border with india et al as a path into the middle east. If the germans could get the indian divisions to fight for them as well as we did (we meaning the british) then china would be in poor shape, but remember Britain had a history with india. Overall i feel that Germanys encroaching of indonesia would strangle japan petroleum reserves, which once depleted would struggle to recover without the china oil pipe line proposed by peace party prime minister Konoye.
And thus japan would probably strave to death, unable to fend off the german fleet which would primarily be based out of the gulfs.
But that’s just my opinion and all I can be arsed to think on the matter right now.