Have you tried resetting the PRAM? (Restart, holding Opt-Command- P & R. Hold those 4 keys until you hear the boot chime at least 2 times. It may not boot far enough to do that , but you should try it. Hold for up to 2 minutes before you give up. If the power simply shuts off, don't waste your time then
Have you ever pressed the SMU reset button? It's the second button, underneath the internal power button.
LED #1 will always be on when the power cord is plugged in, unless the power supply is not working properly.
LED 2 should come on after the power is turned on. It just means that the computer is powered on, and the power supply (again) is working OK
LED 3 comes on when the logic board is providing a video signal. If #3 comes on, the LCD screen should be bright.
So, your iMac is not turning the screen on, and is just shutting off at that point.
Try different RAM, or just one RAM chip at a time.
If there's no change after trying RAM chips, try removing the optical drive (the CD/DVD drive). If you still get no video, and continues to just shut off, then most likely failure is the video chip, which is part of the logic board.
Although replacing the capacitors will often be a good fix, that doesn't always fix every issue. The video chip may have failed during the other problems that you had.