This could have been a new era for Thai democracy.

The public resoundingly ended a near-decade of military rule last year, handing an electoral mandate to a progressive party and a forceful prime minister candidate who represented none of the old power makers.

Just 15 months later, things are entirely different, and the voters had nothing to do with it. The winning party has been banned, and its candidate barred from holding office. The consensus choice who emerged then to form a government as prime minister was abruptly ousted by a top court this week.

On Friday morning, Parliament dealt the next card up, choosing Paetongtarn Shinawatra — the 37-year-old heir to a powerful and polarizing Thai political dynasty — to be the country’s new prime minister.

For many Thais, the decisions made in the past week were the latest evidence that the country is controlled by a military and royalist establishment that is bent on denying the people’s will, using the courts and the army’s presence to winnow the field.

The sudden rise of Ms. Paetongtarn has seemingly settled a period of political limbo, at least for a while. But it has added to the frustration of voters and political activists who had worked within the democratic system.