I have both a hub & mid drive, the hub is a 250/1000w, the 250w being the legal power output for uk roads, max speed 15.5 mph. The mid drive is a bafang 750w, currently broken, stator & rotor burnt out. I prefer the simplicity of the rear hub & have no problems climbing hills with the seven speed freewheel. The hub is easier to work on & is half the price to replace, I've seen cheaper rear hubs, but my current model has covered 10,000 miles without any issues, its 8 yrs old & cost £150 back in 2015. The bafang cost me £360 back in 2021& is going to cost me £160 to fix & had only covered a tenth of the milage of the hub when it broke. I also like the way the power comes in on the hub, thump throttle & PAS fitted. The bafang was fun, but it'll end up being sold or given away for parts.I see in many posts folks recommend mid drive for climbing, since that design uses the chain & sprocket gearing and is in effect more torquey than hub drive motors.
I would like to point out that it really depends on the hub drive arrangement. There is not only the power rating of the motor, how taxed the motor is in that arrangement but the power the controller can pump out and the power the battery pack(s) can pump out. Any of those things can be the limiting factor for hill climbing.
Not only that, but let's not forget that most hub motors are geared, so they can make sufficient torque. (there are some huge direct-drive ones, but even those are more for high speed than high torque and more typical bicycling speeds) One last factor with regards to that is that a hub motor geared for max 20 mph will make more torque than the same motor geared for 25, 28 or 35 mph.
One comparative example from my fleet:
Bike 1: Lectric XP Lite
Battery is 48 V x 7 Ah = 336 Wh. It's a pretty modest battery.
Motor is 350 W sustained, but has a much higher peak power output of 720 W. This means the motor is not very taxed in normal use.
This bike is also limited to 20 mph; no way to unlock it further. Therefore, Lectric chose a motor that was geared down. It provides better torque than one would think and actually does quite well climbing hills. (it has to, because it's a single speed and is geared way too high for the rider to help much with hill-climbing)
Tires are 20", which effectively gears it down, compared to a similar bike with bigger wheel diameter.
Bike 2: Aventon Level.2
Battery is 48 V x 14 Ah = 672 Wh. Twice as powerful as Bike 1.
Motor is 500 W, 750 W peak. About the same peak power as the little motor in the XP Lite! Lectric allows more headroom in their spec. They're not playing The Ratings Game quite as hard....
The bike is assisted up to 28 mph when unlocked from Class 2 to Class 3, so it can't be geared as low, either.
I don't know about the controller current spec for either bike, but Lectric's display shows instantaneous current, if desired. It seems to be limited to 10 A. I bet the Level.2's controller is not limited so low.
The result is that the XP Lite climbs on motor power just as well or maybe a little better than the more powerful (battery AND motor) Level.2.
Just something to consider before making blanket recommendations for mid drive bikes costing $2700 and up.