The choice of which is better is based on several situations. The motor of a mid-drive e-bike is placed in-between the pedals, so there is little or no additional weight to the bicycle. This is something riders would get to appreciate when it comes to long distance cycling.
On the other hand, a hub motor is what propels the wheels of a bicycle. On a steep road, the hub motor will be very driving slow and if the rider tries to increase it, the result may be catastrophic. In summary, the motor that would serve you better is largely determined by you.