Interesting question, re: Rafa in 2007 vs Carlos in 2024. They were born within a month of each other (17 years apart!), so I think we can compare those seasons to each other.
In terms of pure accomplishments through those years (with the caveat that Carlos isn't done with 2024):
RAFA: 3-2 in Slam Finals (plus 2 QF), two TF semifinals, 9 Masters, 23 overall titles.
CARLOS: 4-0 in Slam Finals (plus 3 SF, 3 QF), 1 TF semifinal, 5 Masters, 15 overall titles.
On the surface, Alcaraz's record is better, and the notable edge Rafa had was in +8 smaller titles, mostly ATP 500s. In my PEP system, Alcaraz is at 88, Rafa was at 109 (for comparison's sake, career totals for Marat Safin are 86, Gustavo Kuerten 90, Thomas Muster 107). Alcaraz probably won't quite bridge the gap, as he'd have to win the US Open and several other titles (but it is possible; certainly he's going to finish the season with close to 100 PEP, if not more).
As far as ability, it is harder to say. My guess is that 2007 Rafa would have handily beat Carlos on clay, but Carlos would have handily beat him on grass. Rafa would have had the edge on slower hards, Carlos on medium to fast.
My sense is that Carlos is a more complete player than Rafa at the same age. Rafa was ungodly on clay, approaching great elsewhere, and then filled out in 2008 as an all-courter. But I do think there's still a big gap between peak Rafa on clay and Carlos anywhere, but that could be said about just about any player.