A controversial plan to build a large electricity storage plant in the Herefordshire countryside has been narrowly approved.