Reset the PMU: Unplug your G5, locate the PMU reset button. It's below the lower RAM slots, just forward of the power connector. Click it briefly. After 10 seconds, plug the power cord back in. See if the system boots, or at least the symptoms change.
If the behavior doesn't change, check the voltage on the battery. It should be 3.2-3.7 volts. If it's below that, replace.
If the behavior still doesn't change, things get scary. It's likely to be one/both CPUs, the motherboard, or the power supply. You can check to see if the CPU mounting screws have loosened, or you could pull the lower CPU to see if the system will start up with one CPU. Or check the power supply connector - there should be 5v DC between pins 1 and 23 when the system is off.