the razr will outlast the s4 in battery life hands down (im sure some will say the battery in the s4 is great but the razr is a beast).
i haven't had a single problem with my razr but some people have, thats one thing to consider.
i haven't had a s4 so i cant comment on that, but if i was looking to get a new phone now, i would get the new droid maxx out of all the options.
Although I agree 100% with what he ^ said, I think (if I'm reading the question correctly), you were asking between the SGS4 and the Motorola Droid RAZR MAXX HD.
Since I've owned (and own), the Droid RAZR MAXX (but not the HD) as well as now also owning the as S4, I can speak from experience as to the "MAXX" genre's battery life, and compare at least that "beast" to the SGS4 in many aspects. Do those aspects of the RAZR MAXX transfer to the Razr MAXX HD? Well, since I haven't experienced the HD, I can't say for sure but I'm sure others will chime in.
1) I LOVE the build quality of the Motorola phones. There's NO comparison between my MAXX and the new SGS4 in terms of feel and look. The MAXX wins "hands down".
2) In terms of radio, again the Motorola wins "hands down". I have limited 4G service inside my home, but the MAXX can always hold a 4G signal, even when it's only 1 bar. By comparison, the SGS4 will often drop into 3G at certain places, most irritatingly in my bedroom where I often sit up at night and moderate the site and communicate while watching late-night TV.
3) Same holds true of the WIFI. In my home, the MAXX will always hold a WIFI signal with the antenna on my router located at one end of my 70' long ranch home with cinder block interior walls (the walls are load bearing), and me in the bedroom at the opposite end. The SGS4 will lose WIFI in the bedroom and will either drop first to 4G, then quickly to 3G most often, or sometimes right to 3G.
4) As for battery life...there is NO comparison. I realize the screen of the SGS4 is larger, brighter, much higher resolution so more pixels to power, and that also means more work for the graphics and display drivers, which also translates to even more power consumption, but I have to carry a spare battery with the SGS4 (from day one), where I've not had one day since getting the MAXX that it didn't last completely through the entire day, unless I forgot to charge the night before in which case it would be begging for a charge before the late show is on.
5) The edges of the MAXX have a rubber grommet that sits between the front anodized Aluminum clam-shell half and the rear one (which includes the Kevlar back). Believe it or not, that rubber (which extends out a little bit past the Aluminum shell on the sides and bottom), has saved my phone from at least 2 drops onto bathroom tile. In both cases, I couldn't find ONE hint of damage to the phone at all, not a scratch, dent, crack, etc. In contrast the edges of the SGS4 are bare brushed Aluminum with NO protection of any kind. With the MAXX, I ran naked...with the SGS4, I've put a rubber case around it from day one, so now it's not as visually appealing, heavier, thicker, and the WOW factor is lost.
6) Motorola makes EXCELLENT docks for their phones. They are easy to use, very secure, and they offer a wide variety of functionality. By contrast the SGS4 doesn't have a comparable dock for my car to the one I had for the MAXX. It seems they've went with a "Universal fit" - pinch type gripper dock. The one I wound up with is an iBolt dock, also a pinch type. Both styles require you to physically insert the USB plug into the phone. I much prefer the form-fitted Motorola dock, which not only fits snug and secure, but is a breeze to put the phone into and take out of, and you don't have to finagle the USB plug into the phone, instead it's lined up perfectly and you simply press the sliding USB adapter into place with the push of a finger.
There are lots more reasons why I like one more than another, but since I can't speak to the speed, screen size, resolution, etc. between the Motorola Droid Razr MAXX HD because I don't own one, I'll let others fill in the blanks.