So your USB keyboard and mouse do not work? You can try resetting SMU (power management). Normally, I'd suggest resetting PRAM first
but that may not work if your USB keyboard is not working... If resetting PRAM does work, I guess the USB port connected to the keyboard must be working. If it does not help (or does not work), this is the procedure to reset SMU on iMac G5
When you connect it back to power, if you were using a power strip of some type, try connecting it directly to a wall outlet by itself (at least initially). Start it up with nothing except power cord connected, then add standard keyboard and mouse. Note if they are working or not. If they are working, is your problem with other USB devices also solved?