Is it an iMac G5 or a PowerMac G5? It makes a pretty big difference, because the iMac G5 line was known for bad capacitors that could do what you describe. It would be rather impressive if yours managed to take this long to die, but not unheard of.
If it's a PowerMac G5 then we would need to further know if this is a water cooled unit or air cooled, and if it's single or dual CPU.
Also, there are some Mac specific forums you could post to in the future. You're already here, so no point reposting, just for future reference.
You should let the Apple Hardware Test run. Sometimes a particular test might take a little while. AHT isn't exactly great at giving feedback that it's still doing anything. A failing of virtually all Apple's hardware tools. If the quick test doesn't finish within say 10 minutes, it's safe to assume it's not going to. The extended test can take 30-45 minutes easy depending on how much RAM you have installed.
The machine is 6 years old and is used in a non-business, home environment. Just recently it started to exhibit a slow 4-5 minute boot-up, then runs fine until left to rest, then after 5-10 minutes screen goes black and the fans come on at top speed. At that point it will not come back to life; it simply has to be turned off and rebooted. I ran Apple's hardware test and in both quick and extended test mode it gets hung up after about 2 minutes while checking the logic board without any error message.