Hi yes I am having the same problem as you are. It depends on what revision iMac G5 you have, If you have a revision "a" chances are you need to replace the bottom fan. Usually fans buzz loudly when the bearings are going bad or the fan itself is unbalanced or loose. I have googled far and wide and the only solution I can find is to buy a replacement part 🙁
You'll want to find out exactly what fan is the offender by opening up your iMac and putting your ear directly to each fan to find which one is making the noise and then find a proper replacement.