This is a difficult match-up to decide . Aside from IG Thanos and maybe Dormammu, Ego has possibly the biggest overall power of any MCU character. His takeover of the entire universe would have involved an insane amount of energy. But despite this, his actual combat feats were pretty unimpressive and Thor would have no trouble smashing through his Kurt Russell forms.
At the same time, Thor could technically just planet-bust using the Bifrost, although he most likely isn't going to do that in character. I feel that, given enough time, Thor could eventually deal enough damage to Ego to get through to his core and from there obliterate him using Stormbreaker. And even if he gets into a tight spot, he can still use the Bifrost to make a quick exit.
So Thor takes it, although it'd definitely be a long, hard slog.