Sounds a bit like theory. How does a Hunter (or even Beastmaster) Ranger get better access to advantage than a Fighter? You really use Ensnaring Strike instead of Hunters Mark? On casters it might work well. Maybe they changed Horde Breaker but when I tried it, it was quite awful and quite seldomly possible. If it was appliable, it were mostly not the affected chars you wanted to prioritise for damage. Anyway, it's not nearly as good as three attacks and Action Surge. A Champion Fighter falls a bit behind, but Battlemaster and Eldritch Knight are better than any Ranger build.
Warlocks can do more damage and give more safety than Rangers, just saw that in my Honour mode playthrough. Repelling Blast is one of the least interesting Warlock abilities however.
Beastmaster gets a spider that can web effectively at will, it's one of the best advantage granting methods in the game (and can be quite reliable in conjunction with reverb), but I was referring to Warlock not fighter, and that's somewhat irrelevant since I'm advocating for Hunter rather than beastmaster. Even then it was rather glib, I wasn't considering the Devil's Sight / Darkness combo which is exceptional for granting advantage (albeit at the cost of the efficacy of the rest of your team vs that target).
As to ensnaring strike vs Hunters Mark, they're not even close in my eyes. Hunters Mark gives +3.5 damage per subsequent hit at the cost of consuming a bonus action that could've been used to shoot them. Let's say you've got a 70% chance to hit, and are using Sharpshooter and deal on average 20 damage, that means you need to hit them 4 times subsequently before it becomes worth it. The more damage you do per hit, the worse it gets to give up an attack for that marginal damage increase. Ensnaring Strike, you're moving your chance to hit from 70% to 91% (average 14 to average 18.2), *and* improving the hit chance of the rest of your party, *and* improve your crit rate in a way which gets better the higher your crit range is (5% to 10% if on 20, 10% to 20% if on 19, etc). Advantage is one of the most powerful effects in the game, the additional damage from hunter's mark is... nice I guess? I suppose it has some upside synergy with the strange conduit ring in that you get a concentration effect while it's not actively up, but Longstrider can also do that as a ritual cast, so even then it's not really my cup of tea.
As to action surge, you can always dip Fighter 2 if it's that important to you. It's ok; before 11 it's an extra 2 attacks 1/short rest (not bad, but not as useful as Horde Breaker even if you're not actively working on getting the positioning lined up), after 11 it's 3 extra attacks 1/short rest and they've got 3 attacks consistently as compared to 3 attacks inconsistently so indeed it's better single target damage. By then though you either have Action Surge if you really want it, or have Volley, which can represent far more than that situationally and especially if you're pushing people around via shoves, repelling blast, and tempest cleric chicanery to clump them up, which has advantages not just for your ranger but also your storm sorc and any other AOE damage dealers. Fighter has better single target damage than ranger, true. Not as good as an optimized Barb or Monk or especially Bard, but better than Ranger. Ranger blows them out of the water in terms of total damage output though if you put even a little effort into positioning.
Warlock total damage output and safety vs Ranger, that hasn't been my experience at all. But hey, glad you like them, my experience has been that they're fun and can pull of some cheesy and cool tricks, but they're squishy, low damage output, and low out of combat utility compared to most other classes; I honestly feel they're one of the weakest classes in BG3 if not *the* weakest, but maybe I'm building them wrong. If you found them to be exceptional in your playthrough, how did you build them and what kind of gear were you using?