I have to wonder though whether the red, eastern, route might offer internal benefits that make it more worth Iran's while. I am not at all sure the Iranian government of the age could possibly pay for it, and wonder whether it could later in the Pahlevi era, doubting it.
To refer briefly to external factors, Russia/USSR are always antagonistic in interests, are they not? Basically Iranians have good reason to fear being overwhelmed by Russian power, which fear expresses itself in different ideological forms but the underlying apprehension remains. At the same time Iranians have a bad experience with British (later, more briefly, US) dominance as well.
So--an ATL which seeks to set the stage for such a canal would need to increase Iranian sway over the Caspian, so that Iranians are much richer and more technically developed, and see the desire to connect the seas as an internal matter. Or somehow smooth relations between Russians and Persians, perhaps setting up a situation where the latter see the former as patrons and mentors and the Russians see the Persians as trustworthy friends. But then the Russians don't actually need a canal, they can just use railroads to ship stuff to Iranian ports, and assist Iran in building a proxy navy that projects both Iranian and Russian interests. A strong indigenous Marxist radical revolutionary movement in Iran might be able to negotiate partnership with the USSR without being swallowed up into the status of Soviet satellite.
Given Russo-Persian antagonism, the canal does not get built, except maybe if Iran is part of an aggressively anti-Russian alliance of some kind, and the canal is being built from the Gulf northward to threaten to pour anti-Russian naval assets into the Caspian--pretty much the opposite of what Russians want! If the Russians can protest--if say, we are in the nuclear age postWWII--that puts paid to that program!
Given Russo-Persian friendship, the canal is not really necessary. Perhaps it would be conceived mainly as an internal improvement for Iran, and if so, I think the eastern route marked in red would be favored, to bring water into the dry zones. Even if it is salt water, evaporation will moisten the region. I note some basins apparently below sea level. However I don't think sea level channels connecting to the Iranian SE shore are possible so all water must be pumped through locks anyway. Besides the Caspian is quite elevated, isn't it?
A third international scenario is that either Russians are never successful in conquering the Caspian region or else their rule there collapses later, and the dynamics are between Iran and some Central Asian power, or perhaps Iran manages to make the Caspian an internal Iranian lake?
Anyway it would be nice if someone could evaluate the actual costs involved at varying tech levels, comparing them with Suez and Panama Canal costs.