Horses for courses. At some tasks, the dual G4 would slaughter the iMac. At others, not so much.
If you equip the G4 with a graphics cared of similar or better spec than the iMacs, and max the RAM (2GB), it should beat it at most things. The imac should have faster hard drive access unless you get a SATA PCI card and drive for the G4.

GFX card in the iMac should be based on an nVidia FX5200. You can pick one of these up cheap out of a PowerMac G5 and snip a couple of pins to fit it most PMG4s. Certainly the last few (MDD) models.

Overall, the G4 will be faster and definitely a more versatile machine.