But Rangers get very few spell slots, I find relying on them not very promising. Hunter's Mark is meh, but at least you can use it (most often) in several fights till the next long rest. I don't like to long rest often.
You can get advantage from several sources (items for example), I prefer each group member rely on their own if possible. As a pure damage dealer, I think Fighter is still better. In my party, from Act 3 onwards, there is no place for both of the classes however, as I need a Paladin and already have a Cleric and Wizard (all three way stronger than Fighter or Ranger) and don't like to play Fighter or Ranger. BTW I'm talking about Honour mode, in normal modes it's a bit different.
Warlocks can outdamage Rangers relatively easily. At least in Honour mode. With Darkness and Hunger of Hadar they have fantastic area spells. Rangers as Beastmasters have at least access to Darkness and are probably more versatile for the group. Comparing Sorcerer or Wizard with Warlock abilities or Warlock multiclasses to Rangers or Ranger multiclasses would be of course quite unfair, Rangers/Ranger multiclasses cannot compete by far.
In the end I would go by the flavour of the class. Do you want physical or magical strikers, do you like the Ranger nature theme, can you live with depending on a possibly evil master as source of power, do you like minions? A Warlock is not a good class for minions.
Do you know Aestus_RPG, one of the most informed Youtubers making content about BG3? I don't agree with anything, a lot remains personal preference, but he gives good insight in class relations in my opinion, and I concur with him concerning Rangers, Fighters and Warlocks at least.