When he was elected president six years ago, Felipe Calderon appointed a bright and energetic political operator to fix the country’s wreck of a public education system, where teachers buy and sell their jobs and half the children drop out after junior high.

That politician was Josefina Vazquez Mota, who served as his loyal minister of education for 27 months — before she was sacrificed by Calderon in an act of political expediency and crushed by her nemesis, Elba Esther Gordillo, the “president for life” of the national teachers union, one of the largest labor organizations in the world.

Vazquez Mota is running in the July 1 presidential election as the standard-bearer of Calderon’s ruling party, the first viable female candidate in Mexico’s modern history. But she is trailing, slipping to third place, according to the latest polls, still trying to convince voters that she and her center-right party will deliver real change.

Far removed from the media spotlight on the violence of the U.S.-backed war against the drug cartels here, the struggles of Calderon and Vazquez Mota to transform the nation’s public education system show how a vision of a more modern Mexico continues to clash with an old Mexico beset by charges of corruption and cronyism.

In the past few days, teachers have been accused of stealing copies of a national exam in an effort to boost student scores. And teachers refusing to take exams to prove their basic competency abandoned their schools in protest, while Calderon proclaimed that “enough is enough” and pleaded with them to get back in the classroom.

At risk of failure

“The education system is in deep crisis and is at risk of complete failure,” said David Calderon, no relation to the president, leader of a reform group called Mexicanos Primero, or Mexicans First, which produced a documentary that was a box office hit about the sad state of the schools called “De Panzazo,” slang for “barely passing.”

By most measures, Mexico’s education system is an underachiever. The country is a member of the Group of 20 and boasts of the world’s 14th-largest economy, but only a quarter of its children graduate from high school. Sixth-graders in Mexico get 562 hours of “instructional learning” a year. In South Korea, it’s 1,195 hours, according to Mexicans First.

The country’s bad schools have pushed millions of poorly educated migrants to make their way illegally to the United States to seek jobs and opportunity. Mexico’s growing middle class is abandoning the public schools in droves, paying high tuitions for private academies.

While test scores have inched up a few points in the past decade, Mexico is still bumping along the bottom among the member states of the Organization for Economic Cooperation and Development, a club of industrial nations. In the latest international exams, more than half of Mexican 15-year-olds scored at the lower levels in math and did only a bit better in reading and reasoning.

‘A very corrupt system’

Yet Mexico’s lame performance is not about money. A generous 20 percent of the country’s budget goes to education, about $30 billion a year. More than 90 percent goes to salaries — negotiated by the teachers union, which dictates policy.

“It was — and sadly still is — a very corrupt system,” said Carlos Ornelos, a specialist in education at the Autonomous Metropolitan University who was one of the first, in the 1990s, to expose the practice of teachers buying and selling their jobs.

An elementary school teaching post, a tenured position for life, still sells for as much as $20,000 in the resort city of Cancun, and a post in a rural village can be had for $2,000, Ornelas said.

Although the marketplace is now more discreet, the practice purportedly continues. The group Mexicans First estimates that 40 percent of the teaching jobs are still sold, or inherited, or exchanged for political or even sexual favors.

“It is a scandal,” Ornelos said. “In the 2006 campaigns, Calderon was the only one talking about it. He called it a national embarrassment.”

When Calderon appointed Vazquez Mota as secretary of public education in 2007, the two vowed to end the practice. They wanted to push teachers to take exams in order to get a job and to receive pay raises.

At the center of any debate about education in Mexico looms Gordillo, whose 1.4 million union members may make or break political candidates. Called La Maestra, or the Teacher — with a mix of respect and a measure of irony — Gordillo is famous for her designer clothes, a condo in Southern California and a face transformed by plastic surgery.

In 2005, she and the union created their own political party, called the New Alliance. In 2008, she gave Hummers to her union deputies (after a scandal ensued, she said the SUVs were to be auctioned to raise money for schools).

Hounded by charges, denied and never proved, that she has enriched herself at the public’s expense, one critic called Gordillo “Jimmy Hoffa in a dress,” after the infamous Teamsters Union leader. The financial accounts of her union have never been made public.

Gordillo is bigger than Hoffa was. For the past 23 years, Mexican presidents have come and gone promising to reform education, but the Teacher remains the ultimate wheeler-dealer, often described as the second-most-powerful person in Mexico.

She declined to be interviewed by The Washington Post.

Calderon owed at least a slice of his razor-thin victory in 2006 to the head of the teachers union. A lifelong militant and former general secretary in the Institutional Revolutionary Party, or PRI, Gordillo switched sides in the election to back Calderon and to sway her members to follow.

The PRI kicked her out.

After his election, Calderon appointed Gordillo’s allies to various top posts in the government, including her son-in-law Fernando Gonzalez as deputy secretary of education. Calderon cut a deal with Gordillo that the union, not the government, should lead on reforms, to avoid mass protests and shuttered schools, according to insiders at the education ministry.

Calderon said that the appointments were promises made by the outgoing administration and that he felt compelled to honor them. He said that making the union a partner in reform was pragmatic.

‘An impossible position’

“This put Josefina in an impossible position. She was in the line of fire, trying to break this perverse cycle where the union made all the decisions and there was no improvement,” said Miguel Szekely, who served as one of Vazquez Mota’s deputies in the education ministry.

Nevertheless, Vazquez Mota said she achieved some success. “I was able to reach an agreement with the teachers union so the positions for new teachers would go through a contest of merit. Before that, some teachers, when they were retiring, used to sell their posts, and not necessarily to other teachers,” she said in an interview.

Vazquez Mota also pressed state governors to produce employment rolls, which showed that many teachers worked only for the union and not in the classroom; she made public standardized test scores, which were embarrassing but gave Mexico a benchmark from which to improve.

But after 21 / 2 years, Vazquez Mota was out. At a tearful goodbye attended by Calderon, she resigned and went on to take a seat in Mexico’s congress.

“Why was Josefina fired?” said the former foreign minister and commentator Jorge Casteneda. “Because La Maestra asked for her head on a platter, and Calderon delivered it.”

In July, about a quarter-million teachers are scheduled to take competency exams. Union leaders in several states are advising their members to boycott the tests.

No matter. Mexico’s ministry of education revealed last week that nothing will happen — one way or the other — to teachers who take or don’t take the exam.

It is purely for diagnostic purposes, the ministry explained.