Every Tuesday, Wednesday and Thursday, in a courthouse nestled amid high-rise apartment blocks in south-west Moscow, nine men are marched into a room in handcuffs and placed in metal cages. They are joined by three others who are also on trial but under house arrest or on bail, two dozen lawyers, several armed policemen with a growling alsatian and an irritable, fatigued judge.

This is the biggest of the "Bolotnaya" trials – court processes against 28 people who were arrested in the aftermath of a rally on Bolotnaya Square on 6 May 2012. It was the day before Vladimir Putin was inaugurated for a new presidential term, and the crowds chanted slogans demanding new elections and a less corrupt government. A year-and- a-half later, the protest movement has been extinguished, though it lingers in the consciousness of Moscow's middle classes, and Putin has embarked on a more socially conservative path to consolidate his support in the heartlands.

The arrests were a warning that Putin would not tolerate the huge protests that preceded his re-election and heralded a crackdown. Among those protesting was charismatic opposition leader Alexei Navalny, who was later put on trial in the city of Kirov on embezzlement charges that few found persuasive.

The Bolotnaya arrests were alarming mainly because of their randomness. They were a sign to iPad-toting young Muscovites that protesting was not without consequences. In a way, any of the thousands who protested that day could have ended up in the metal cage. Those on trial are mainly accused of resisting or assaulting police, but although there was isolated violence at the rally there is little to suggest most of those on trial were involved, and police who come to court to testify remember little. At one point on Thursday, one of the defendants asks questions of the policeman on the witness stand, from inside the cage. Vladimir Akimenkov, 26, faces a possible eight-year sentence on charges of throwing a flagpole at a policeman, though the only evidence is oral testimony from one officer. He is losing his sight from a serious eye condition, which is progressing in jail, but the judge refuses to bail him for treatment.

His inquiries on Thursday have little to do with the accusations; instead he asks the police officer on the stand if he has any moral conscience.

"Do you think whatever is good for Gazprom is good for Russia?"

"The question is removed from the record," says the judge.

"Do you follow every single order you are given? If ordered to shoot into a crowd of protesters, would you do so?"

"The question is removed from the record," says the judge.

And so it continues, interminably. The prosecution alone has hundreds of witnesses to call, most of them police. Getting through the first 40 has taken months, partly because there are two dozen lawyers, all asking questions, two-thirds of which are struck off the record. At this pace the case will take two years, says lawyer Sergei Badamshin.

Mikhail Kosenko, another one of those accused, was deemed mentally ill and tried separately. Last month he was confined to indefinite forced psychiatric treatment by a judge, despite never having committed a crime or having violent episodes prior to his arrest. Many of the others are simply sitting in pre-trial detention, for over a year already, with no sign of a trial even starting.

Maria Baronova, 29, is one of the 12 on trial, although she is not kept in jail but is allowed to live at home on the condition she does not leave Moscow. She says the trial – and the lack of interest in it from those who once formed the protest movement – shows that the waves of anti-Putin discontent are over.

"It's finished. We lost. That's it. There is no hope," she says. "You can try to help people get out of jail. You can go back to your jobs and try to forget about it. But the fact remains we lost, and nothing is going to change here."

"The sense that protests are cool and something that is fun to be part of has of course gone," says Maria Lipman, of the Moscow Carnegie Centre. She said the arrest of the Bolotnaya 28 has had a devastating impact on the protest mood.

The memory of the protests still remains, however. In the minds of the urban elite, and in the towers of the Kremlin, there is an understanding that the young, progressive class has deserted Putin, in spirit if not in body. This has led to the third-term Putin promoting a less inclusive political agenda and taking a sharp shift towards social conservatism.

"Putin has abandoned his claim to be the leader of all the Russians; now he is the leader of Putin's Russians," says Lipman. "And there are increasing numbers of people who have become 'bad' and 'unpatriotic' Russians, whether it be liberals, gays or blasphemers."

A new law that criminalises "homosexual propaganda" was passed this summer, while NGOsnon-governmental groups which receive money from abroad must register themselves as "foreign agents". State television whips up hysteria about the nefarious influence of the US state department, and Putin has positioned Russia as the last bastion of traditional values in Europe. The punk band Pussy Riot were thrown into prison for hooliganism, and acts like the Greenpeace protest against Arctic drilling are seen as an assault on Russia's sovereignty.

Despite the crackdown, there have been concessions to Moscow's protest-oriented middle class. Under mayor Sergei Sobyanin, life for professional Muscovites has become more liveable. Parks have been redeveloped, the local equivalent of "Boris bikes" were introduced this year, and pleasant cafes and restaurants are springing up. Nightlife is as vibrant as ever and now caters to a fashion-conscious youth obsessed with western trends. A major repaving programme has turned grimy dead zones into pleasant pedestrianised walkways almost overnight. More and more, Moscow is a nice place to live, not just for the super-rich but for the middle class too.

"The main paradox of living in Moscow today is that you can carve out a very New York or London-like existence here," says Michael Idov, editor of GQ Russia. "If you find these dots on the map and connect them and never stray from these routes, life is very comfortable. As long as you don't interact with the state in any way, shape or form."

What to do with the political aspirations of these young people remains a dilemma. There was outrage when Navalny was tried and sentenced to five years. Next day, when the prosecutor launched an unprecedented appeal for his release on bail, it was clear there had been a phone call from Moscow and that someone wanted him free for Moscow's mayoral elections in September. He gained 27% of the vote and his jail term was amended on appeal to a suspended sentence.

But last week new corruption charges were brought against Navalny and his brother, which could mean 10 years in jail. It seems the debate over whether Navalny is more dangerous in or out of jail is still raging.

"The Kremlin is not a cohesive group of like-minded policy makers," says Lipman. "There is always a debate going on about whether softer or harder approaches are best."

Putin is stuck with the classic dilemma of the soft autocrat. Does he allow a controlled liberalisation, with the possibility that he could lose control of the process, or does he crack down? After all, it was exactly the better-off segment of Muscovites, who had enjoyed increasing salaries and exposure to the west, who formed the core of the protest movement that sprang up so unexpectedly two years ago.

To make sure those demands do not become too loud, the Bolotnaya case rumbles on, with its protagonists trying to engage with the absurdity of proceedings, but being struck down repeatedly by the judge, Natalia Nikishina.

Baronova says that people regularly tell her to flee abroad, but she feels a duty to see through the court case. Nevertheless, the process is so byzantine, and its logic so frustrating, that she feels her grasp of reality slipping away.

"It's like Kafka's Castle," she says. "Engaging with the Castle is pointless. Trying to talk to the Castle is pointless. All it will do is send you mad. The whole process is designed to send you completely insane. That's far scarier than a possible prison sentence."