What are security advantages of tor over I2P?
Tor and I2P have a number of similarities. Tor however has a big benefit when you are leaving the Tor network. I2P's exit system is basically a really limited set of proxies, which makes attacking you by analyzing the traffic at the exit easier. It's a game of numbers. There are very few exit nodes (they call them outproxies sometimes) compared to Tor.
Another thing here is the Tor Browser Bundle. It's a strongly patched version of Firefox that gives you a number of protections. On I2P you usually use an unpatched browser that is easier to track.
Next to that Tor has a bigger academic research community, finding way to attack it and proposing ways to fix it. This is something that's really important in everything security related.
A great comparison can be found here:
For a better answer a specific use case would be required. There are many people running Tor for many purposes, being a relay, avoiding censorship, browsing the web anonymously, setting up a hidden service, etc. The answer may vary depending on the perspective and the use case.