A quick skim of the news reveals a couple of things that are likely to be true:
(1) Both leading candidates were within the orthodox mainstream of Iranian political thought on political issues, despite the fact that they had serious disagreements with each other. Neither the incumbent nor the challenger was a Western pawn.
(2) There was probably genuine, large scale election fraud (although it is possible that the winner would have won anyway by a slight margin if the process had been conducted properly).
(3) Protesters pointing out the fraud are likely to be put down, perhaps brutally, with the support of Iran's Supreme leader, who functions in practice a bit like a constitutional monarch, by the existing regime from which they have no real appeal.
Suppose that you know that the fraud happened, and know that protesters are likely to be punished for pointing out this fact. What is the best course of action, assuming that your real policy preference is for clean democratic elections?
On one hand, not protesting makes the fraud's success a self-fulfilling prophecy, and undermines the credibility and effectiveness of the electoral machinery politically. A major protest can create an incentive for a more honest process the next time, and bring to bear what little international influence is available, even if it doesn't change the outcome this time. But, a major protest could also create an incentive to maintain a tighter grip to prevent the public from seizing control from the regime in the future.
On the other hand, being labeled as a political dissident in an authoritarian state which may be on a liberalizing track anyway, may reduce your ability to bring about future political change at a more portentous moment.