With G4s there are a number of different methods to try the thing to stay on when it displays your symptoms.
Depending on model you may have a CUDA swith or PMU (power management). When the machine won't turn on, the first thing to do is usually to reset one of these. Tropuble is that it varies with differnet models.
Before playing with this you might think about the PRAM battery. Sometimes, when they wear out, it screws up power management so if you reset the cuda or pmu with the dead battery, the fix does not hold after you turn the thing off.
Here's just one of the fixes. This pertains to G4 - PCI.
1. Unplug the computer.
2. Press the Power On button on the front of the unit.
3. Open the side access panel.
4. Remove the battery from the logic board.
5. Wait at least 10 minutes before replacing the battery.
6. Make sure the battery is installed in the correct +/- direction.
7. Reassemble the computer and test the unit.
That's from tha Apple support site. You should ascerttain what model you have and go to Apple support, select G4 and then search for CUDA, PMU, "machine will not start", etc.
Whenever you play around with CUDA of PMU all PRAM gets wiped so you have to reset things like date,time, etc.
Using OSX 10.3.8 on a G4