No it isn't. You're assuming perfect information, when the reality is nowhere near as clear. I certainly believe that Iran killed a lot of protesters recently. Undoubtedly some of them were innocent. Some others were collaborators; Israel is well known to be engaged in a shadow war with Iran and to have infiltrated a large number of people within the Iranian security apparatus. I'm thus extremely skeptical of any specific claims around numbers for the foreseeable future.
The problem with this simplistic utilitarianism is that assumes a degree of omniscience that doesn't exist. You can excuse any atrocity by claiming it's an unavoidable by product of a high-minded end. Life rarely presents neat classic trolley problems, and even if it did there are many unknowns; for example, are you sacrificing the life of one saint to save five serial killers? Absent this information I'd opt to save one person, but would be doing so with the awareness that I might be making a very bad decision for which I'll have to take responsibility.
In this case, the trolley is in a whole other country. Unilaterally attacking it (while negotiations were ongoing) is regarded by most experts as a blatant violation of international law and that's the primary reason nominally allied countries are refusing to assist.
You're giving the regime far more of the benefit of the doubt than they deserve. Their crimes are well documented.
Aside from that, the risk of accidentally bombing a school is also an unknown quantity. So we're looking at "risk of leaving the regime in place" vs "risk of accidentally bombing kids". Feels plenty trolly-ish to me.
No matter how inept or corrupt the process, the fact is some bombs fell out of the sky and killed a bunch of unelected dictators who just weeks ago murdered thousands of their own countrymen. In my eye, this is an excellent precedent. If it means paying a few more dollars for gas, so be it.