When our sun burns out it will do no good to hide on Mars or the moon.
The sun brightens over time. In 3 billion years, it will be to the point where Mars recieves what Earth does today as far as solar heat, and Earth will get what Venus does now. That situation will last a billion years or so where Mars will be temperate and Earth too hot for habitation.
This will be BEFORE the sun becomes a red giant.