Microsoft is battling Amazon.com and Alphabet for dominance in Japan, which is spending billions to develop an artificial intelligence ecosystem and catch up to the U.S. and China.