Plans for a major battery energy storage facility in County Durham have been rejected after hundreds of objections from residents.