@OP, you stated that your other bike is much faster with lighter wheels and groupset etc... but, you did not mention the tyres. Have you try a better tyre on the gravel bike?
I rode last summer and autumn on G-One ***** and Ultra ***** (I mean Bite and Ultra Bite) and they were slow and horrible, going up hill was not pleasant (but good to improve fitness)... I swapped back to conti RaceKing and CrossKing and they are much faster; on the fitness/test loop (20k) I am 5 to 10 minutes faster and I can climb the same hills on 1 or 2 cogs harder.
When checking the rolling resistance on the website with a similar name, the G-One were about 30-33W and Race King was about 19-22W. ~33% less rolling resistance which you can feel.
May be check your tyres there:
https://www.bicyclerollingresistance.com/ and see if you could find something with less resistance which will help up hill.