Hydrogen is made by electrolysis of water which uses electricity to split the water molecule into hydrogen (H2) and oxygen(O2). Ammonia (NH3) can be made in two ways, the first being the reaction of hydrogen and nitrogen taken from the air in what is known as the Haber-Bosch process, and the second approach currently being developed, which goes by the name solid state ammonia synthesis(SSAS). All three methods can produce a hydrogen rich fuel, either H2 or NH3 as a means to store electricity and no one is better than the others; each has their place in the big scheme of things.
Hydrogen production by electrolysis is as much as 85% efficient and Haber-Bosch made ammonia is only 65% in terms of energy recovered. SSAS promises to increase efficiency to 75% to 80%. If you are most concerned with efficiency and you don't need to transport the hydrogen via pipeline or tanker truck, and you don't need to store it, hydrogen is the way to go, but do read the FAQ section on hydrogen as a fuel; it's nasty stuff to handle.
So ammonia only returns two thirds of the energy you put into it if you use it for a fuel. The rest of the input energy is released as heat during the formation process, much of it in the electrolysis step. Ammonia is nice because we already know how to store, transport, and safely handle it. There is a 3,100 mile pipeline network within the U.S. and over 800 filling stations in Iowa - we're pretty much ready to start using ammonia as a farm fuel just as soon as engine conversion kits are widely available.
Solid state ammonia synthesis is a wild card. It's brand new, not yet tested on industrial scales, but very attractive because it makes ammonia as efficiently as hydrogen via electrolysis and we already have the infrastructure to store and transport ammonia. Once SSAS reactors are available we'll see every little town in Iowa running a few wind turbines to fill an ammonia tank and converting their generators from diesel to 95% ammonia/5% hydrogen.
Why would we ever make ammonia using the Haber-Bosch method? The Haber-Bosch process is a very old, well tested method, and it makes good sense if we gather the half of the energy that would have been considered waste heat and use it to run greenhouses.