One of the main reasons why Yoda would've won against Anakin is simply because he was far better trained than him. Yoda could see the moves his opponents were going to make before they made them; therefore, battling against Anakin would've put him at a far heavier advantage.
There are certainly scenarios where Darth Vader would have the upper hand in a duel with Yoda, but in most cases, Yoda would be the more likely victor. Vader wields absurd levels of Force power during his dark side prime that would certainly rival Yoda's own abilities, but likely not exceed them.
Yoda still stands as one of the most powerful characters in Star Wars, yet even he couldn't defeat Palpatine. After their battle in Revenge of the Sith, Yoda felt beaten and fled into exile on Dagobah, where he hid away for 19 years.
When Palpatine reveals himself as a Sith Lord to Anakin in Revenge of the Sith, a small detail shows that he considered dueling Anakin. A small detail in Star Wars: Episode III – Revenge of the Sith suggests that Palpatine toyed with the idea of killing Anakin—before he had fully seduced him to the dark side.
Obi Wan told Yoda, “Send me to kill the emperor, I cannot kill Anakin.” But after seeing what Anakin did to Padme and the way he had completely turned from the Jedi and had joined the Sith, he resolved to kill him: “I will do what I must.” He was actually the first one who ignited his lightsaber against Anakin.
Before he discovered Vader had survived Mustafar, Obi-wan lived with the regret of killing his son, brother and best friend. After, he regretted not killing him and wondered if he had only made things worse by pushing Anakin further into dark side and Palpatine's arms.
Master Yoda failed Anakin Skywalker in Star Wars: Episode II — Attack of the Clones, and it resulted in the destruction of the Jedi Order. Master Yoda is one of the most revered characters in the Star Wars universe, and for good reason, but he ultimately failed in stopping the rise of the Sith.
He slays Sidious and returns to Obi-Wan, begging for atonement by execution, only to be met with true forgiveness instead. But just as this fantasy Obi-Wan refuses to strike his former friend down, Vader refuses to turn his back on the dark.
In Star Wars Legends and Canon, Galen Marek (Starkiller) is the only Jedi (other than Obi-Wan Kenobi) to put a beat down on Darth Vader/Anakin Skywalker. Galen was secretly trained as a Sith Lord apprentice to Vader, but returned to the light side and the Jedi.
This is confirmed later in the movie when Obi-Wan informs Padme that Anakin killed them. Both are torn apart with hurt and confusion, trying to make sense of something so terrible.
More cunning and devious than all but the most attuned Force-sensitive beings, Darth Bane could more than likely defeat Yoda in a battle of both strength and wit.
Yoda was tempted by the dark side on a few occasions throughout his life. If he fell to the Sith ways, he would've been more powerful than Palpatine. If Yoda had turned to the dark side in Star Wars, he would have eclipsed the might of even the strongest Sith Master, Emporer Palpatine.
Yoda was a legendary member of the Jedi Council as a Grand Master of the Jedi Order and member of a mysterious species capable of living for centuries. He was stronger than most in a connection to the Force and though he was small in size, he'd been so powerful and wise having had trained Jedi for several centuries.
Over the years since the Youngling massacre, and even sometime before, Darth Vader has regretted killing the Younglings, recognizing that it was the most terrible thing he had ever done.
Jedi Master Yoda is the most powerful of them all. This should come as no surprise, as he was the head of the Jedi Order in the prequels and was revered for his abilities during the original trilogy. Yoda's power is unmatched and was a real threat to Darth Vader and the Imperials.
1 Darth Sidious
There has been no Sith, as powerful, meticulous, nor as evil as the Emperor himself, Darth Sidious. As previously mentioned, Sidious trained in the Dark Side by Darth Plagueis before Sidious killed Plagueis in his sleep, making Sidious a Sith Master.
By the time of Episode 3; Anakin is in his prime, and already one of the Jedi Order's most powerful “masters” (although technically still a knight), just behind Obi-Wan, Windu, and Yoda. Maul wouldn't stand a chance. Anakin stomps.
Even Master Yoda doesn't have a midi-chlorian count that high." Anakin was stronger however, he didn't really master his powers until he became Darth Vader. ^ that just means he had more potential than Yoda. He never reached that potential, ergo he is not as powerful as Yoda.
Luke Skywalker
However, once Luke fully embraced his power in Star Wars: Return of the Jedi, he proved that he was indeed stronger than Darth Vader and struck his father down.
Anakin admits to Obi-Wan that he has been arrogant and unappreciative of his training, and apologizes to his master. Obi-Wan assures Anakin that he is proud of him, telling him that he has become a "far greater Jedi than I could ever hope to be."
Obi-Wan knew it was only a matter of time. So, he made the difficult decision to use his learnings and become one with the force, rather than let Vader decapitate him. Who knows; losing one's head may make it more difficult to transition smoothly into a Force ghost.
As powerful as Darth Sidious may have been, it's easy to forget he actually seemed afraid of Master Yoda. As seen in Revenge of the Sith, Palpatine initially thought he could deal with the aged Jedi Master - and then, when Yoda proved able to counter the Sith Lord's Force lightning, he fled.
But Palpatine was far more focused and felt that he was beyond needless revenge, as in his mind he had already won by defeating the Jedi. So in the end, Palpatine was content with his victory over the Jedi and felt it pointless to personally hunt down Yoda out of revenge.
Jedi were forbidden from taking a political appointment. They were taught that their loyalty was to be to the Force, the Jedi Order, the Republic and to themselves, in that order.