Traffic was disrupted on a major Harrogate road when a railway level crossing failed for almost five hours.