Japan's prime minister is optimistic his country and the US can avoid a tit-for-tat tariff war, saying Donald Trump acknowledges Japan's investment in the US.