Plato did not seem to think that the philosopher kings will come to power from the ruins of a tyranny. Rather, they will rise in a still- functioning tyranny.
His idea seem to be this: Among the multitude of tyrannies that humanity is bound to suffer, there will sometimes be the happy occasion that the ruling tyrant himself will be truly enlightened - a philosopher - a philosopher king. Such a ruler will have both the knowledge and the means to build a meritocratic-philosophical state.
The first step is the most drastic: the ruler will have to send away all the citizens, except for all the children whose age is ten or less.. Those children will hence be the clay, that the first philosopher king will mold into a meritocratic-philosophical state.
This recipe is presented near the end of book VII of the Republic:
•Well, I said, and you would agree (would you not?) that what has been said about the State and the government is not a mere dream, and although difficult not impossible, but only possible in the way which has been supposed; that is to say, when the true philosopher kings are born in a State, one or more of them, despising the honours of this present world which they deem mean and worthless, esteeming above all things right and the honour that springs from right, and regarding justice as the greatest and most necessary of all things, whose ministers they are, and whose principles will be exalted by them when they set in order their own city?
•How will they proceed?
•They will begin by sending out into the country all the inhabitants of the city who are more than ten years old, and will take possession of their children, who will be unaffected by the habits of their parents; these they will train in their own habits and laws, I mean in the laws which we have given them: and in this way the State and constitution of which we were speaking will soonest and most easily attain happiness, and the nation which has such a constitution will gain most.
•Yes, that will be the best way. And I think, Socrates, that you have very well described how, if ever, such a constitution might come into being.