my first brand new iphone 3g had a bad battery right from the store. They replaced the phone with a refurbished one after 5 days of owning it. So much for getting a new phone!
As for Android, every model is different. I had a samsung captivate which was replaced 3 times - a POS. Then I moved over to the Droid X, couldn't be happier. Just received the latest Gingerbread update and the battery is amazing now. I had 50% charge left after 23 hours of unplugging from charger. Droid X is a solid phone.