No Contest. Gmail.
Okay, are you serious? That's like asking, which would you rather have: a $10,000 dollar bill or a 50? piece.
Gmail is astronomically better than Yahoo.
I used Yahoo Mail for several years, and then in April of 2004 I switched to Gmail. It is superior in every way. There is no tradeoff.
1. Spam. In the past 5 years, I have received about 10 spam messages in my Inbox. Gmail has caught the rest. I've had exactly 1 message that was NOT spam, marked as spam. So ~11 messages incorrectly flagged in 5 years.
2. Storage. With Gmail, you don't ever delete your old emails. You just "Archive" it, and it gets sent into the "All Mail" folder. This folder has (you guessed it) all your mail. You don't have to worry about "Do I delete this to save space? What if I need this email later?" Gmail gives you tons of storage--so just archive it, then you have it in case you need it.
3. Search. Instead of sorting your emails into folders so you can browse to them more easily later, you just search. Gmail searches your email ridiculously fast.
These are the main reasons to use Gmail instead of Yahoo.
When it comes to the iPhone specifically, Gmail syncs with the iPhone mail app. It's syncs 2-way, so your mail on your phone and your mail in the cloud are always the same.
The Gmail web app (in Safari) for the iPhone is slick and fast.
To be fair, I haven't used Yahoo Mail in Safari on the iPhone. But I don't see how it could possibly improve upon Gmail.
Hope this helps!
PS: I don't have any affiliation with Google. lol