Caution! This answer is really long!
It really depends on which version of each character you use. I’ll do the weakest version of each character first, then slowly move up to the strongest.
The weakest Obito we’ve seen is him as a young kid in Team Minato. The weakest Nagato we’ve seen is him as kid when he first meets Yahiko and Konan.
This version of Obito had just awakened his Sharingan and his natural element affinity was Fire (Like most Uchihas). He doesn’t have very many feats except for being able to see an invisible dude, but anyone with a Sharingan would be able to, and helping Kakashi take down Kakko with the ultimate teamwork.
This version of Nagato already had the Rinnegan, but didn’t know how to use all its powers. I don’t think his affinity was ever specified, but I do know that he could eventually use all five elements, but I don’t know at what age. He has very minimal feats and it’s when he killed the people who accidentally murdered his parents.
I think Obito wins this one. He has more feats and without knowing any of the Rinnegans abilities, it only has the powers of a regular Sharingan anyways. At a young age, Obito was shown that he knows Ninjutsu and some Taijutsu, while it’s never shown how Nagato killed the two men, so we don’t know if it was Ninjutsu or Taijutsu. So the winner for round one is Obito.
2nd Weakest Versions-
The second weakest versions of each of them is Rampage Obito, when he saw Rin die, and Rampage Nagato, when Yahiko killed himself with Nagatos Kunai.
This version of Obito has just awakened his Mangekyo Sharingan, and had obtained arguably the most hax ability in Naruto, that being the Kamui. This version of Obito also has Hashiramas cells, and Wood Release. His feats are being able to smash a huge boulder, and killing more than atleast 50 Hidden Mist shinobi.
This version of Nagato had already trained with Jiraiya and had most likely already learned to use all five basic elements. He also trained his Rinnegan and was able to use more of its abilities. His feats are being able to hold off Hanzos shinobi, being able to summon the Gedo Mazo, and being able to deflect Kunai with the Deva Path.
I think the winner of this is Nagato, since he has the Gedo Mazo and could just use the Deva Path to pull Obito towards him, and Obito had just awakened Kamui, so he probably wasn’t the greatest at using properly at the time. So the winner for round two is Nagato.
3rd Weakest Versions-
The 3rd Weakest version of Obito is Yellow Mask Obito when he attacked Konoha. The 3rd Strongest Nagato is when he controlled the Six Paths of Pain.
This version of Obito was able to go Toe to Toe with Minato, and he would’ve won against anyone else that can’t teleport. The reason he lost is because Minato is a genius and can teleport, but Obito strategy was pretty much Flawless against anyone Unless your name is Minato. To make this fair, Obito also has control of Kurama. His feats are going Toe to Toe with the Fourth Hokage and summoning Kurama.
This version of Nagato possesses all Seven Paths (Including the Outer Path which is Nagato) and was rivaling Sage Mode Naruto, eventually the Deva Path was to much for SM Naruto so he had to use the Eight Tails. His feats are killing Hanzo, killing Jiraiya, going Toe to Toe with SM Naruto, destroying, then reviving Konoha, etc.
Even with Kurama, this is going to be a tough one for Obito, but he still has Kamui, and his chains. I think Kurama barely pushes the edge in Obitos favor, and may give him the win. So the winner of round three is no one. They tie.
3rd Strongest Versions-
The third strongest version of Obito is DMS Obito when fighting Kaguya. The third strongest version of Nagato is still when he had the Pains.
This version of Obito has DMS which means his Kamui goes much faster than before, he can still become intangible, and he can use Kamui from a distance now. His feats are fighting with Kaguya and saving Kakashi with Kamui.
Even though he doesn’t have Kurama now, this version of Obito is leaps stronger than the other version, and he would almost definitely come out the winner. So the winner of round four is Obito.
2nd Stongest Versions-
The second strongest version of Obito is single Rinnegan Obito with white mask in the Great Ninja War when everyone thought he was Madara. The second strongest version of Nagato is weakened state of Edo Tensei Nagato.
This version of Obito has a Rinnegan and is pretty equal with his DMS version, but here he has access to the Gedo Mazo and Seven of the tailed beasts and their Jincuriki. He also has every element here. His feats are fighting evenly (for the most part) with Kakashi, fighting evenly with Kakashi, Guy, Naruto, Kurama, Gyuiki, and Bee when he was able to use Rinnegan, etc etc.
Edo Nagato (Weakened)
This version of Nagato was able to go Toe to Toe with Bee and Naruto until Itachi Un-Edo Tenseiified himself and turned the tides. Nagato was able to summon giant animals to fight for him and use Chibaku Tensei, the Preta Path and pretty much all the other paths probably but it’s unknown.
Obito wins by a mile. So the winner of round five is Obito.
Obitos strongest version is Ten Tails Jinchuriki Mode and Nagatos is Rejuvenated Edo Mode.
This version of Obito was able to become unparalleled and it took all of the allied shinobi forces just to rip the tailed beasts out of him. He was able to wield and control the Truth Seeking Orbs and nobody could stop him according to Tobiramas and Hashirama. He was however getting tagged by Naruto and Sasuke but it did no damage until they used Senjutsu attacks. He also cannot use Kamui. His feats are almost killing Naruto and Sasuke until Minato saves him and I don’t want to name anymore because there is a shit ton. So etc.
Edo Nagato (Rejuvenated)
This version of Nagato was able to surpass both Bee and Naruto and would’ve undoubtedly won, had Itachi not broken control of his Edo Tensei. He was able to use all of the paths but eventually ended up getting sealed by Itachis Totsuka Blade. His feats are almost killing Bee with Asura Path, and a lot more that I just don’t want to name so etc again.
Obito literally one shots in half a second. So the winner of the final round is once again Obito.
I know I missed some version like Orange mask Obito and less controlled Ten tails Obito, but that was because Orange mask version is basically Yellow mask version, just without chains, no Kurama, and he has better control of Kamui and more knowledgeable. Less control Ten Tails Obito is just a weaker, more unstable Juubito. The reason I skipped these is because there isn’t very many versions of Nagato, and they were similar to other versions of him.
So my Final Verdict is Obito wins.
Hope I could help!