Keep in mind that a mountain bike has a more upright seating position. A gravel bike has a drop handlebar and the attendant aggressive riding position.
If you want to lay down some serious mileage the latter is better. But it does take some commitment and getting used to. A drop bar bike is going to be uncomfortable at first.