Controversial plans to build a battery plant on rural land east of Leeds can go ahead after a successful planning appeal.