Ash is for sure losing to Hapu. She can mop the floor with almost all of Ash's team because every single one of his Pokemon (aside from Rowlet) is weak to Ground. And, some people (not me) think that Rowlet is gonna stay a Rowlet.
Since the writers have already had Ash lose to Nanu once here, I doubt they will once again have him lose against Hapu. Ash at least looses one Gym battle per region and in SM he has fulfilled their criteria here against Nanu. So I don't see much of a reason for him to lose against Hapu.
If the writers want Ash to win against Hapu right off the bat, he will, as simple as that. Then plot armour would be in Ash's favour and nothing would stop Ash from winning.
And you do realise that type advantage isn't everything in the anime otherwise:
1) Ash's Charizard had no business defeating Gary's Golem + Blastoise with Charizard having a 4× weakness to Rock and 2× weakness to Water.
2) Iris's Dragonite had no business defeating Georgia's Beartic + Dawn's Mamoswine with Dragonite having 4× weaknesses to Ice in both cases.
3) Ash-Greninja had no business winning against Sawyer's Mega Sceptile with Mega Sceptile having 4× resistance to Water and Ash-Greninja having 2× weakness to Grass.
So see, type advantage isn't everything in the anime when the plot demands for someone to win.
And it doesn't matter what many people think, because we still can't rule out Ash's Rowlet evolving, there is still time left for it. If Rowlet evolves against Hapu, Ash has a very great chance of winning there.
So no, you can't anyway guarantee that Ash would lose to Hapu.