Why shouldn't Japan care about Ukraine? If Ukraine can be invaded and the rest of the world does nothing, then why bother having borders or nations or the rule of law? If Ukraine's territory doesn't matter, then why should Japan's territory matter?
Japan was one of 15 votes on the UN Security Council to pass it.