It isn’t just red, but green, blue, yellow, and other colors can be found. Most often these colors are found at intersections or areas where roads merge. They do it to provide some contrast to the scene in order to alert the driver that something is different and that they should pay attention.
I've never seen any green or yellow roads in Japan. I might have seen blue roads designated for bicycling. So I'm dubious about that unsupported Quora answer.
What do green, blue, yellow roads mean in Japan? Does it mean a vague "pay attention", as the quote below claims, or do they have a clearer meaning? I'd be surprised if Japan uses 4 colors for the same meaning.
Example of a red road in Japan: