No, you shouldn't break the law of course. Pedelecs only have assist motors so do need a reasonable input from the rider to cope, especially on the steepest hills.
However, some do have very high torque motors which cope far better, so one of those might suit. What make and model was the...