Revelers participate in the traditional 28th Bloco da Lama (Mud block) carnival in on March 1, 2014, in Paraty, Rio de Janeiro State, Brazil. The event, which was begun by two men in a playful manner in 1986, has now become a traditional carnival in which participants disguised as primitives with rags, lianas or skulls and bones, dive in the mud. (Victor Moriyama/Getty Images)

José de Moraes leapt into the air as if possessed by the frenzied rhythm that his drummers were beating out. As master of the drum section of his Carnaval street party, or bloco, his job was to choreograph the furious samba beats that sent revelers wild.

He leapt and danced like a rubber man in the midst of the bloco, called Paraty do Amanhã (Paraty of Tomorrow), on a narrow street in this popular tourist town on the Rio de Janeiro coast that attracts more than a million visitors a year.

For Brazilians, Carnaval is a five-day national escape from the harsher realities of life. The year in Brazil only really begins after Carnaval, which wrapped up Tuesday.

But the optimism for which Brazilians are famous was absent among this bloco’s drummers and musicians as they contemplated the year ahead, a year in which their country will stage the soccer World Cup.

Drummer Jhaimerson Santana, 21, said he supports his national team but was against the “enormous costs” of building stadiums. He, Moraes and singer Rodrigo Penha, 38, all said they expected protests during the World Cup, like those that sent a million people into Brazilian streets in June.

Soccer is important, even vital, they said, but they think the money could be better spent elsewhere — in Paraty, for instance. The town desperately lacks basic sanitation, decent education, jobs for its youths and reliable public health service.

“These make Paraty difficult,” Santana said.

This charming colonial town is one of Brazil’s postcard tourist destinations. It stages an international literary festival, FLIP, and thousands flock here for Carnaval each year. But in its frustrations and problems, Paraty is a microcosm of Brazil.

In addition to its faulty services and infrastructure, it has a homicide rate that is more than twice the national average. Paraty had a population of 37,500 in the 2010 census, the last available. The city registered 27 killings in 2013, up from 23 in 2012 and 17 in 2011.

Julio Waiselfisz, a coordinator of violence studies at the Latin American Faculty of Social Sciences in Rio de Janeiro, said the 2013 total gives Paraty a homicide rate of 68.6 per 100,000, more than twice the Brazilian average of 27 per 100,000 in recent years.

“It is too much,” Santana said. “The fault is with those responsible for the city.”

Like Moraes, Santana lives in Mangueira (Mango Tree), a poor neighborhood just a 10-minute walk from the town’s historic center but one of the worst hit by violence, which residents and authorities blame on the drug trade.

On Monday afternoon, Moraes pointed out a quiet street that divides Mangueira from another poor district, Ilha das Cobras (Island of the Snakes). “There is a fight over the [drug] traffic, from two factions,” he said.

Ilha das Cobras is controlled by the Comando Vermelho (Red Command). Mangueira is under the influence of the Terceiro Comando (Third Command). Both are affiliated to Rio gangs of the same name, locals said.

Moraes and Santana know people who have died in the violence, and they scoff at official assurances that the situation has been resolved.

“This ‘security improvement’ does not exist,” Moraes said. Many of the gangsters are just teenagers, he added. “It is 14. It is 15,” he said. “It’s absurd.”

The administration of Mayor Carlos Miranda has just signed a $36 million public-private partnership as part of Paraty’s first public sanitation project. The city relies either on septic treatment for sewage or pumps the waste straight into rivers and from there into the sea.

The mayor, who took office in January 2013, said that when the rudimentary septic systems fail, sewage flows into the street.

“When you enter the historic center, you see sometimes that the road is wet,” he said. “It’s the sewage.”

He said that the city had gone through a violent period but that things had improved. “In the last 10, eight months, we had a very big reversion,” he said.

Homicide numbers have fallen slightly in recent months — there were no killings in November and two in December.

Marcos da Silva, head of Paraty’s civil police, said the authorities have succeeded in stemming the crime wave. “It is a response to the police work,” he said.

But he said that he needs 40 investigating officers, rather than the 18 he has, and that the city needs better education for its youths.

Both the mayor and the musicians from Paraty do Amanhã agreed that basic sanitation is a good place to start resolving the city’s problems. But Penha, the bloco’s singer, outlined another problem that Paraty, like many Brazilian cities, faces: a complete lack of faith in its political leaders.

Penha, who works in the municipal chamber in nearby Angra dos Reis, has stood unsuccessfully for public office, an experience that he said has put him off politics for life.

“People think everyone involved with politics is corrupt,” he said. “So when we get involved in politics, people start to imagine it is us as well. They think that good people can’t get involved in politics.”

On Tuesday, Moraes and his bloco paraded in shirts that proclaimed their favorite Rio soccer teams and sweated over their instruments. Soccer and samba are inseparably linked, he said, and a 90-minute game offers an escape from the problems of life, much like Carnaval does.

It was this, Moraes suggested, that was behind the decision to stage the World Cup in Brazil.

“It’s a political thing,” he said. “ ‘Let’s give them a cup, for them to have happiness in life.’ ”