The Kepler space telescope has proven capable of detecting transits of objects almost as small as the Earth's Moon. Some studies suggest that moons as small as 0.2 Earth masses can be detected in the Kepler data by transit timing variations and transit duration variations of their host planets. If such massive moons exist around giant planets in the stellar habitable zone (HZ), then they could serve as habitats for extraterrestrial life. While earlier studies on exomoon habitability assumed the host planet to be in thermal equilibrium with the absorbed stellar flux, we here extend this concept by including the planetary luminosity from evolutionary shrinking. Our aim is to assess the danger of exomoons to be in a runaway greenhouse state due to extensive heating from the planet. We apply pre-computed evolution tracks for giant planets to calculate the incident planetary radiation on the moon as a function of time. Added to the stellar flux, the total illumination yields constraints on a moon's habitability. Ultimately, we include tidal heating to evaluate a moon's energy budget. We use a semi-analytical formula to parameterize the critical flux for the moon to experience a runaway greenhouse effect. Planetary illumination from a 13-Jupiter-mass planet onto an Earth-sized moon at a distance of ten Jupiter radii can drive a runaway greenhouse state on the moon for about 200 million years (Myr). When stellar illumination equivalent to that received by Earth from the Sun is added, then the runaway greenhouse holds for about 500 Myr. After 1000 Myr, the planet's habitable edge has moved inward to about six Jupiter radii. Exomoons in orbits with eccentricities of 0.1 experience strong tidal heating; they must orbit a 13-Jupiter-mass host beyond 29 or 18 Jupiter radii after 100 Myr (at the inner and outer boundaries of the stellar HZ, respectively), and beyond 13 Jupiter radii (in both cases) after 1000 Myr to be habitable. If a roughly Earth-sized, Earth-mass moon would be detected in orbit around a giant planet, and if the planet–moon duet would orbit in the stellar HZ, then it will be crucial to recover the orbital history of the moon. If, for example, such a moon around a 13-Jupiter-mass planet has been closer than 20 Jupiter radii to its host during the first few hundred million years at least, then it might have lost substantial amounts of its initial water reservoir and be uninhabitable today.