RIO DE JANEIRO — The bumpy ride in the rickety van heads up the steep hill into Morro da Providência, this city’s oldest favela. Last stop: a small, silent square with a hardware shop, bar and pair of young policemen in armored gear toting machine guns, patrolling the still-unopened cable-car station that the city has recently built. The port spreads out below.

Spurred by two looming mega-events — the World Cup next year and the Summer Olympics in 2016 — local officials are struggling to reinvent this onetime third-world city with a first-world economy.

Last weekend, demolition began on a busy highway that cuts a path through the port area, to make way for a pedestrian promenade and new tram.

Rio’s mayor, Eduardo Paes, is saying all the right things about combating sprawl, beefing up mass transit, constructing new schools, and pacifying and integrating the favelas, where one in five city residents lives, with the rest of the city.

But as months of street protests illustrate, progressive ideals run up against age-old, intractable problems in this city where class difference and corruption are nearly as immovable as the mountains. This is a city divided on itself.

That divide is nowhere more apparent than in the mayor’s gargantuan, $4 billion port redevelopment plan, which envisions turning an industrial area on the scale of Lower Manhattan into the glittering, skyscraper-filled hub for a new global Rio.

The historic heart of the city, with Portuguese and Afro-Brazilian roots, a mix of warehouses, heavy machinery and old landmarks, the port also encompasses neighborhoods like Morro da Conceição and Saúde, Gamboa and Santo Cristo: poor, run-down but pretty enclaves of multicolored houses and cobblestone streets. Washington Fajardo, who advises the mayor on urban affairs and historic preservation, showed me the stone wharf, for imperial and slave ships, that has recently been unearthed near Morro da Conceição and made into a heritage site.

But the port redevelopment is mostly a commercial real estate deal, another example, critics complain, of a government in thrall to developers, with a new Museum of Tomorrow (whatever that may be), shaped like a giant flailing isopod, designed by Santiago Calatrava, yesterday’s architect. There is no real master plan, no guarantee that what’s good and worth preserving about the urban mix of the existing port won’t be sacrificed to a sea of office towers. Recent promises by the mayor to insert 2,000 units of public housing are belated and vague, announced to appease detractors while not upsetting investors.

And while the mayor promotes consolidation around the revamped port, Rio sprawls uncontrollably west. Miles of highways, gated apartment blocks, malls and traffic jams make the area called Barra da Tijuca increasingly indistinguishable from the outskirts of Dallas or Fort Lauderdale. Cariocas, as people who live here are called, buy two cars and an apartment in a Barra tower if they can afford to, as if this were still 1974.

At the heart of Barra is a symbol of Rio’s profligate spending and class divisions, a new arts center, the City of Music, designed by the French architect Christian de Portzamparc, across from a giant mall with a replica of the Statue of Liberty out front. A project started under the previous mayor, twice over budget at $250 million and marooned in the middle of a highway, the place has provoked angry complaints that it is out of touch with both the city’s culture and its real needs.

A concrete complex of theaters, raised sky high on giant piers, the center may be the most absurd new building in years. It can bring to mind that famous Stonehenge gag from the film “This Is Spinal Tap,” in which a design for a rock concert stage-set mislabeled feet as inches — except the proportions here are reversed. People in charge complained to me about whole sections of unusable seats without views, ineptly designed stages, halls without dressing rooms, windswept plazas and staircases going nowhere.

Farther west, the Olympic Village, accelerating urban sprawl, rises on a site that will become yet more luxury housing after the Games. The development threatens to dislodge Vila Autódromo, a longtime favela. I walked the favela’s quiet, rutted streets. Children bounced on a broken trampoline; music wafted from a church; a family took me onto its rooftop terrace with a view over mango and guava trees onto the bay. Altair Guimaraes, the head of the residents’ association, roused from his nap in a hammock after working the night shift, shook his head. “You don’t need to massacre the people to do mega-events,” he said.

The story isn’t that simple. In the working-class areas to the city’s north, like Méier and Madureira, the city has been providing new clinics, running new bus lines, building schools. I visited Madureira Park, a mile-and-a-half-long, $50 million concrete and green swath with a giant samba stage and water feature, built on land freed up by relocating high-voltage electric lines. The place has been a game changer for residents of a crowded district with precious little open space.

In Méier, I toured an old movie palace where Bob Dylan and Brazil’s Dylan, Tom Jobim, once performed, lately reborn as the João Nogueira Cultural Center, with a multiplex, exhibition space and a rooftop terrace. Old men sunbathed and teenagers flirted in the shade of a concrete trellis.

But alongside those upgrades, other public projects make no sense: the Minha Casa Minha Vida (My House My Life) projects are glum new housing blocks for the poor, cheaply made, proliferating around the city, many far out west, a long distance from where resettled residents used to live. Morar Carioca, a public program to bring architects together with favela residents and public officials, promised collaborative solutions to redevelopment. Residents in Providência, consulted as part of the program, said they wanted clean streets and paved roads.

The city decided instead to construct the cable car, along with a funicular and a cultural center commemorating favela life, all projects requiring evictions. So much for Morar Carioca, many residents now lament.

“Favelas are not just places of poverty whose dwellers are objects of ‘renewal projects,’ ” as Jailson de Souza e Silva, a founder of Observatório de Favelas, a social agency, has pointed out. “Participation is the key.”

That’s still not common practice here. Community representatives from Providência have won a court injunction to delay the construction of the funicular. Roberto Marinho, 38, president of the residents’ association, works as a manager of a real estate office downtown. The house where he lives with his wife and two children, he said, is one of the homes that would be demolished.

“We have a veranda and terrace, and the Minha Casa Minha Vida apartment they want to move us into would be a big step down,” Mr. Marinho told me. Favelas like Providência, the historic incubators for samba and Brazilian funk, could be, from one perspective, models of what Mayor Paes advocates: diverse, dense, organically developed, tightly knit enclaves of de facto affordable housing — the opposite of Minha Casa Minha Vida.

But those cable cars and cultural attractions, the standard tool kit for city face-lifts today, make good illustrations for Olympic brochures and PowerPoint presentations, even if they aren’t necessarily what residents of Providência, and Rio, need most. Winning community support takes time. Collaboration is slow.

Rio is in a hurry.

“We want a dialogue, a conversation,” was how Mr. Marinho put it. “They never really listen to us.”

A version of this article appears in print on , Section A, Page 1 of the New York edition with the headline: A Divided Rio, Overreaching For the World. Order Reprints | Today’s Paper | Subscribe