Considering that Dooku, Grievous, and Nute Gunray are dead at the end of Revenge of the Sith, would there have been any way for Anakin to learn that Palpatine controlled both sides?
Vader must have known either before or immediately after he killed the Separatist leaders on Mustafar.
Nute Gunray welcomes him as "Lord Vader" when he arrives in the Mustafar control room:
Welcome, Lord Vader. We've been expecting you.
Gunray would only know to use Vader's Sith name and would only be expecting him if he had been dealing with Sidious.
More conclusively, Gunray later pleads for his life and mentions Sidious by his Sith name:
The war is over. Lord Sidious promised us peace...
From these statements, Vader knew that Nute Gunray -- the leader of the Separatists -- was making deals with Darth Sidious. Consequently, Vader would have known that Sidious/Palpatine was controlling both sides of the war.
Quotes are from the Episode III script.
Vader knew that Palpatine is not only A Sith Lord but THE Sith Lord. The one they'd spent years looking for. The one they knew was behind the Separatist movement. In fact, he says as much to Mace Windu before deciding to betray the Jedi Order.
Anakin Skywalker: He won't give up his power. I just learned the terrible truth. I think Chancellor Palpatine is a Sith Lord.
Mace Windu: [suprised] A Sith Lord?
Anakin Skywalker: Yes, the one we've been looking for.
He knew all of this before making the desperate decision to betray the Jedi Order and pledge allegiance to Palpatine.
It would come as no surprise to him that Palpatine knew where the Separatist leaders were located and would come as no surprise that Gunray told him that Palpatine promised them peace. He was too desperate to save Padme's life and angry at the Jedi to care.
Since you merely asked "Would there have been a way", the answer is clearly "yes":
He knows that Palpatine was a Sith Master, after the conclusion of ROTS (well DUH! Do I need a quote to prove that?).
He knows that Dooku was a Sith Lord:
Heat rose in Anakin's cheeks. "I am not—" your Padawan anymore snarled inside his head, but that was adrenaline talking; he bit back the words and said instead, "—going to let you down, Master. Or Chancellor Palpatine." "I have no doubt of that. Just remember that Dooku is no mere Dark Jedi like that Ventress woman; he is a Lord of the Sith. (ROTS novelization by Matthew Stover)
As a matter of fact, Palpatine confirmed it himself:
"Get help!" The edge of panic in his hoarse half whisper sounded real even to Dooku. "You must get help. Neither of you is any match for a Sith Lord!"
He knows about Rule of Two from Palpatine (see "The Sith Lords book")
Actually, he knows about it from the Jedi (ROTS novelization shows this).
AND he clearly realizes Dooku is working with Darth Sidious:
"Or maybe I should say, were two of you," the young Jedi went on. "We're on to your partner Sidious; we tracked him all over the galaxy. He's probably in Jedi custody right now."
So, putting 2+2 (or, 1+1 in this case) together seems like an obvious leap of logic. Not even beyond creepy Anakin's meager mental skills.