Russian military intervention is a possibility, perhaps a probable one but not an absolute certainty Iran should blindly count on.
If it defeats logic, you ought to put the question to Aliyev, to scores of other politicians in Baku as well as to local media as to why they've been openly touting the annexation of Zangezur.
I mean, this is not made up:
Actual shape of Azarbaijan for comparison:
And here an example of a Baku politician calling into question Armenia's sovereignty over the territory:
http://www.dia.az/8/348753-lham-eliyev-deyir-ki-naxchivana-neden-elimiz-yetmesin-ki.html
It's the 2020 ceasefire agreement. What it stipulates is that in order to link up with its enclave of Nakhjavan, Azarbaijan is allowed to use the road and railway leading through Zangezur
on sovereign Armenian land.
So the agreement does not change international borders. Meaning that Baku won't be able to station forces on that territory, will not be able to invite zionists or NATO elements there, simply put it will not be in control of it.
From Iran's perspective, this is hugely different from Baku annexing that strip of land and using it to whatever aims it pleases.
Iran should not and will not rely on another government when it comes to pressing matters affecting her national security and territorial integrity. There's no strict guarantee for Russian military intervention and Iran does well not to bank on it. Even if there was, Iran ought to act independently given the nature of the issue.
In that sense the Leader's statement made it clear that even in the eventuality that Baku reached an understanding about its plans for Zangezur with Russia, improbable as it may be, it will face a reaction from Iran either way. This this was a clear message to Baku and not designed for internal consumption.