Both games are awesome overall and high quality
But for me, Resident Evil 7 wins easily, not because it doesn't have flaws(obvious ones like lack of enemies, proper last boss later fixed with dlc, weak final parts) but because it does its thing so well, and thats delivering a fresh, scary Resident Evil experience on first person.
When i play RE2 i can't help but think its not as scary as 7 or as action packed as 4, were RE2 wins is on the RPD puzzle oriented level design and translating that game to modern engine however even its soundtrack is a little weak
RE7 instead does some things i wanted to see since RE5/6/Rev1 released, but thought Capcom wouldn't do any more, one is a grounded setting, the Baker state is a full classic Resident Evil setting! No super agents fighting monsters just a dude isolated in a house slowly fighting his way off these crazy farmers, my only dissapointment is we didn't see more outside areas like the ones on the intro :^(
Other is giving the typical characters and lore a rest, yeah yeah Ethan is a little bland but the thing is, jill Chris, leon and co are no longer scared, they no longer have an enemy to fight like Wesker, no much point in bringing them to a 'small' BOW incident when they can kung fu Zombies and monsters to death, the lore stuff just became more and more stupid after RE5 so scaling things back after that event is good to me (with the exception of Rev2 wich was awesome). You don't fucking know who is Ethan or Zoe or Mia and thats fine, you only see Mia transforming and cutting Ethan's arm on the intro maybe you didn't care at the end of the game either i did Ethan is cool wich brings me to the next point.
These are freaking amazing antagonists! Jack Baker eats Nemesis for breakfast, what is this TCM family doing in my Resident Evil game? omg can't really say anymore its worth experiencing for anyone that hasn't played this game, they make up for the main characters and more, there is also a very cool dlc guy i wanted to see even more of the Bakers and their home when RE7 ended, not Chris or Leon
Finally, some gamers like to shit on the first person perspective but it works so well on the atmosphere and adds to the scariness/isolation, it also gives the game a unique cinematic feeling Capcom crafted something very special with RE7 and im glad they decided to continue with one more adventure in this style