I actually like both equally but for different reasons. The answer I always give between the two is...
If this is your first Android device and you had to pick between the two, I suggest the HTC One. As I have said in other forums, the HTC One is a great device right out of the box. Its fast, smooth, and a little more familiar if you are coming from the iPhone.
The Samsung Galaxy S4 on the other hand, in my own personal experience (I know everyone is different), was frustrating and laggy and I have been using Android devices since Eclair. However, after rooting, and flashing a custom ROM such as MDOB or GoldenEye (made by the same ROM chef), the experience is much better and is on par if not better than the HTC One. So its just a matter of how much time you are willing to invest in tweaking your devices!
In terms of battery life, they are pretty equal but the S4's battery is replaceable. If you carry an extra battery with you, you will probably never have to worry about battery life no matter how much of a heavy user you are.
I tried going from the IP5 to the HTC ONE and then the Galaxy S4. After a month I am back to my IP5. Stick with an iPhone. Its a better experience.