It is unclear (thus up to the DM)
The effect seems poorly worded, and both interpretations lead to a somewhat dubious conclusion.
If you consider that the spell ending takes away the advantage, then, as you mentioned, the effect is almost guaranteed to not work, except for a Raging Barbarian or some other character with resistance. Five damage on a hit is something pretty much any enemy can deal - a simply modifier of +3 already almost guarantees it, and +4 definitely guarantees it.
On the other hand, if you consider that the effect was already granted and will last until the next attack, then, suppose the combat ends before you get to attack. Then you take a long rest, enter a downtime of 2 weeks, and now you go back to adventure. For some reason you still have advantage on the next attack you make, because some random dude gave a motivational speech to you in a combat you don't even remember any more.
Obviously the second case is more "edge" than the first, but still it shows that not properly defining when the effect ends is awkward. Ultimately, I would go with the interpretation of "next attack you make in this combat".
By the way, the first time I read it, I did interpret it as "the next attack you make has advantage. Period. Doesn't matter if the spell ends.", i.e., the effect that grants the advantage takes place (instantaneous), then the spell ends, but the advantage was already given.
Additionally, comparing both conclusions, one leads to awkward scenarios in very edge cases, the other means that part of the spell is essentially useless, so I would go with the one that allows for awkward edge cases.
From my reading of the spell, though, it is more about the concentration-free advantage on Wisdom saving throws for an entire hour for the entire party than about the temporary hit points or the advantage on one attack. I am not sure not allowing the advantage to take effect would make it really weaker, it just feels completely wrong that the sentence is useless.
An additional argument on why the attack should be made with advantage can be made by comparing the wording with True Strike:
On your next turn, you gain advantage on your first Attack roll against the target, provided that this spell hasn't ended.
Thus, we can infer that, if the advantage was subject to the spell still being active, it would say so, just like True Strike does.
Note that Acquisitions Incorporated is not entirely a WotC book, so wording may be inconsistent with previous books.