> who was democratically elected by the way
He was everything but democratically elected. He was installed. The Iranian people did not elect Mosaddegh. He was put there by a Shah and the elites of the Majlis, neither of which ever represented the people of Iran. At no point in the past century has Iran had representative government.
For the absurd 'democratically elected' premise to be true, there would have to be actual representative government. There wasn't, there isn't.
He was as democratically elected as the system at the time allowed and spent basically his entire political career on increasing the power of the majlis and getting rid of colonial interests.
The UK spent a lot of resources conspiring against this project, which ultimately failed, to a large extent because he did not have a solution to the blockade that followed nationalisation of the oil production. Perhaps he also did not expect as many members of the majlis to join the foreign conspiracy as did when the blockade got inconvenient.
It's also not like democratisation followed under the shah, rather the opposite, like the establishment of rather nasty security services and a nuclear program that the later revolutionaries inherited.