A couple of guys have said, they would take on one shooter. But if two shooters, no way to prevail, so head for the exit.

However this is not necessarily true. A lot of these psycho boys are on a suicide trip, like the two Columbine shooters. They killed themselves.
So, if you had more nerve than the on-duty Columbine school resource officer, who spent the shooting cowering behind his police car, and you entered the school with your Smith and Wesson, and you snuck up behind these punks, and managed to shoot one of them in the back a couple of times, the other one then and there probably would have killed himself.

You have to bear in mind, you are not confronting a Russian Special Forces guy. You are confronting a mentally ill young guy who, though he may have a badass gun, has little if any training. He is by definition a bully and a coward and he does not have a strong warrior spirit.

So yes, a civilian with a pistol and a strong warrior spirit could prevail. He could, and then again, he might get himself killed.