By Paulo Prada

RIO DE JANEIRO (Reuters) - To many in this coastal metropolis, Rio de Janeiro has never had it so good.

After decades of decay, crippling crime rates, and a loss of big business to rival São Paulo, Rio is on the rise. A recent boom in Brazil's economy, the discovery of massive offshore oilfields nearby, and Rio's planned hosting of the World Cup and Olympics in the next four years have restored some of the splendor to the tropical city of 6.5 million people.

But one local official is tired of the exuberance.

Marcelo Freixo, a 45-year-old state assemblyman, thinks Rio needs a reminder of all that is wrong - from uneven development to deep inequality to corruption and organized crime.

Now, the schoolteacher turned human-rights activist turned politician hopes his call for a reality check can help him, in October elections, topple the popular mayor who presides over all the preening.

"What good is all this progress if it's not addressing our core problems?" asks Freixo in his cluttered office behind the state assembly house. "We need better schools, better hospitals, safer neighborhoods, not just spectacle."

It's tempting to dismiss Freixo as a spoilsport. His slight build, heavy brow, and modest wardrobe give him a scholarly, almost clerical, air that runs counter to Rio's colorful cockiness. Were it not for the presence of bodyguards needed after a crackdown he waged on crooked cops, he would still pass for an academic.

But Freixo's arguments matter to many in a city that symbolizes the frustrations of Brazil itself, a country that has long struggled to fulfill its enormous potential.

After past glory as a colonial stronghold, the seat of the Portuguese crown and the capital of an independent Brazil, Rio went into decline when Brasilia became the capital in 1960. As industry grew in São Paulo, Rio lost its standing as Brazil's financial center.

Like the rest of the country, it succumbed to economic volatility for most of the past half-century and suffered poverty, ramshackle development, and crime.

But as Brazil entered a period of sustained growth over the last decade, though, Rio's fortunes reversed.

RECOVERING PAST GLORY

Billions of dollars worth of investments poured in after new oil was discovered south of its famous beaches. Rio is one of 12 venues for the 2014 World Cup and it alone will host the 2016 Olympics, requiring investments of at least $14 billion.

The changing tide has spawned a property boom. Drug lords have been chased out of some of Rio's notorious favelas, or slums. Its decrepit old port is being made over so cruise and luxury vessels can berth at docks until recently lined by crack dens.

Still, the progress lacks balance, Freixo argues.

It's all happening along a narrow strip of coastline that is home to the elite, beaches and tourist attractions, and the corridor where World Cup and Olympic activities will take place.

The rest of the city, Freixo says, remains neglected - giving Rio some of the worst health, educational, and social statistics in Brazil. Murder rates in poor neighborhoods are as much as 20 times higher than those of rich areas, approaching levels of countries at civil war.

"There are millions of cariocas who don't benefit at all from the recent development," he argues, using the term for Rio natives. "The city focuses exclusively on tourism and big events - not the people who actually live here."

SLIM ODDS

Eduardo Paes, the incumbent mayor, disagrees.

New roads and bus lines, Paes argues, are already helping legions who flock daily from working-class neighborhoods. The refurbished port and new Olympic facilities will further development in marginal areas nearby.

Paes scoffs at Freixo's underdog candidacy and his recent advances in polls. He refuses to accept Freixo's charge that the city, obsessed with "spectacle," ignores everything else.

"There is still a lot to do," Paes admits. "No one is saying this is paradise on earth."

Paes heads a coalition of 20 centrist and center-left parties, backed by big business, with a 30-fold advantage in financing. After early advertising - Paes grins from posters on hillsides, lamp posts, and bridges - he enjoys a towering poll lead over Freixo, the second-place candidate, and three others.

Despite the odds, Freixo believes he could force a runoff. What he lacks in financing he makes up for in buzz - enjoying support from intellectuals and artists, including influential songwriter Caetano Veloso, author of his campaign jingle.

He is also drawing growing numbers of young voters, so many of whom turned up for a recent speech that Freixo moved the event at the last minute from an auditorium to a nearby plaza.

Freixo has surprised people before.

He grew up across Guanabara bay in Rio's sister city of Niteroi. Neither of his parents, who worked as support staff at local schools, went past middle school themselves.

A lifelong interest in human rights began when he played soccer, as a teen, in a local jail with convicts on recess. After studying economics and history at a Rio university, Freixo taught in area schools and gave remedial courses in prisons.

As Brazil's military dictatorship gave way to democracy in the mid-1980s, he took part in local organizing for the leftist Workers' Party, now Brazil's dominant political group, and began researching police abuses and prison conditions.

"He has an analytical mind that sees beyond individual incidents and abuses," says Tim Cahill, a London-based researcher for Amnesty International. "He understands the structural and policy problems behind them."

Freixo also caught the eye of Chico Alencar, a state assemblyman, now in Congress, who hired him as an adviser.

After the Workers' Party won Brazil's presidency in 2002, Freixo, Alencar and others grew disaffected by its move to the center. They formed the PSOL, a leftist party known for its focus on education, poverty, and human rights.

In 2005, Renato, a younger brother, was fatally gunned down. Investigators believe the murder was vengeance from crooked police officers after Renato fired them from a moonlighting gig as guards at the building where he lived and acted as superintendent.

The next year, colleagues persuaded Freixo to run for the state assembly. With just over 13,000 votes, the lowest of any Rio legislator that election, he scraped into office.

FIGHTING THE POWER

On his first day in the legislature, Freixo called for the creation of a committee to go after corrupt cops and their infamous militias, which control crime and entire neighborhoods in Rio's sprawling suburbs. Though most legislators resisted - some were on militia payrolls - they relented when a police torture scandal sparked cries for a clean-up.

Ultimately, Freixo's efforts led to the expulsion of four fellow legislators and the indictment of 226 police officers.

The clean-up brought a surge in support.

Freixo was re-elected to the assembly in 2010 with nearly 180,000 votes, more than all but one other Rio legislator. The writers of "Tropa de Elite," a blockbuster film about Rio police, wrote a Freixo character into a sequel.

He also earned new enemies.

Death threats forced the state to equip him with a security detail and an armored car. Last August, a friend, a Niteroi judge hearing militia cases, was shot dead while she drove home. Weeks later, the state security service intercepted a series of credible threats against Freixo.

He decamped to Spain until things calmed down.

Political opponents called his brief exile a publicity stunt. The critique was common among some who find Freixo too earnest, even sanctimonious.

He offers few apologies. "If someone doesn't like what I stand for, that's their problem," Freixo says.

On a recent Thursday afternoon, bodyguards in tow, Freixo took to a pedestrian retail district in central Rio. At one busy corner, he stopped a middle-aged woman, handed her a leaflet, and made his pitch.

"I know who you are," the woman said. "I might be willing to vote for you."

(Editing by Todd Benson and Kieran Murray)