A race is on here among high-powered representatives from five nations who are gambling tens of thousands of dollars to get billions in return. They are placing their bets in well-appointed offices, on private planes and limousines and in scientific seminars.

President Ronald Reagan is believed to be watching with interest, so are French President Francois Mitterrand and Canadian Prime Minister Pierre Elliott Trudeau. The governments of Sweden and West Germny are just as interested.

It is the low-key but high-stakes battle to win the first piece, and possibly all, of Mexico's new atomic energy program. In a slow world market for nuclear power wares, the program is the largest going.

Worth $25 billion at current prices, the Mexican plan aims to build a chain of 20 nuclear reactors across the country to double the national energy production within 20 years. The ambitious scheme is part of Mexico's oil-financed rush into industrialization, which is taking place on a scale and with a speed that currently have no match elsewhere in the developing world.

Since the word has been out about Mexico's nuclear energy goals, heads of government, Cabinet ministers, company presidents and atomic scientists have joined in a costly, elegant and complex courtship of their Mexican counterparts.

"The political and public relations message the Mexicans are getting is of a magnitude you only see in the arms business," said a senior diplomat here.

"I've never seen anything like it, this is the biggest nuclear rush going," commented an industry executive with 20 years experience. "Normally one or two companies negotiate privately with a buyer government. This is the first time there has been a competition of this size, with this number of bidders, over so large a project. It's interesting all right."

The invitation for bids on the first contract, which went out in October, has sent nearly all the West's nuclear reactor suppliers to the drawing board. The major exceptions are a British consortium that suspended operations and the U.S. builders of the ill-fated Three Mile Island plant who "were not invited to participate," according to a local insider.

The men who picked up the 1,000-page specification document are from seven companies, three of them American: Westinghouse, General Electric and Combustion Engineering Inc., along with Atomic Energy of Canada Ltd., ASEA-ATOM AB of Sweden, Kraftwerk Union AG of West Germany and Framatome of France.

While the first contract will be worth $1 billion, the winner is believed to be in an almost certain position to build most or all of the remaining plants, with a production target of 20,000 megawatts of electric power by the year 2000.

"The way to size this up," said a local official, is that "all of Mexico at the moment produces 17,000 megawatts. The overall scheme is about twice as large as those of South Korea, Argentina, Brasil and India," other leading developing nations in various stages of nuclear energy production.

Mexico has the world's fourth largest oil and gas reserves, but the thinking here is that hydrocarbons are too valuable a resource to burn up for electricity for the massive industrial establishment and the hundred million inhabitants expected by the end of this century.

The wooing of Mexico, which has been going on for the past year, is getting more intense as Feb. 5, the date the bids are due, draws near.

It takes place in the National Palace, in embassies and government offices and over dinners with officials from the National Resources Ministry, the Federal Electricity Commission and the National Institute for Nuclear Research. The Mexicans get invited on informative but luxurious trips abroad and they are bombarded, here and everywhere they go, with briefings on the advantages of heavy water versus enriched uranium fuel, on reprocessing and safety. There are seminars on financing and joint ventures and more briefings on the training of personnel.

"Sure this is costing small fortunes, but it's nothing compared to the contract value," one foreign nuclear energy executive here said.

As the seven contestants jockey for position and fire more high technology at the Mexicans, they also try to keep close tabs on each other.

The dizzying pace of diplomatic flag waving is the easiest to gauge. This week, for example, a 10-member U.S. government mission, headed by Kenneth Davis, the deputy secretary of energy, is here for a two-day visit to discuss "nuclear cooperation."

The tally shows that France has already sent President Mitterrand to broach the subject, not to mention a bevy of Cabinet ministers and scientists.

Sweden not only had sent senior delegations but also is soon sending the king. The Germans have dispatched politicians, technicians and executives. Canada's trade minister, whose turf includes nuclear technology, has been here three times. Prime Minister Trudeau, who has already met twice with Mexican President Jose Lopez Portillo is coming again in January, just before the bidding will close.

Last September, on a visit here, Vice President George Bush privately reminded Lopez Portillo of U.S. interest in the deal. President Reagan has made a public pitch for exports of U.S. nuclear technology for peaceful use, but it is not known if he raised the subject personally with the Mexican president.

Beyond the high-powered politicking there is a more discreet level of industrial espionage that ranges from watching the quality of the restaurants to financial proposals in the making.

"The French are the most, well, shall we say, expansive," said a Canadian observer. "They are making a tremendous effort. And of course, they are very grand and generous in their entertainment."

The state-owned Atomic Energy of Canada this summer opened a special office here. To its surprise, it found that soon it was followed by its Swedish competitors a few floors below.

France's public relations drive for the partly state-owned Framatome comes directly from its embassy.

"Should we call it a coincidence that their new science attache is a nuclear physicist," quipped a representative of a private conglomerate.

Westinghouse and General Electric, which both have electrical equipment plants here, have expanded their staff and fly in extra people from the United States whenever it seems necessary.

"Of course we don't tell each other what we're doing," said one high-level executive, who like most people interviewed did not want to be identified "given the sensitivity of all this."

"But we keep people on the ground and we find out about the competition from the Mexicans," he went on, "and the Mexicans are masters at playing us off against each other."

The consensus here is that the Mexicans, while enjoying the courtship so far, have "bent over backward to remain fair in the bidding process," as one executive put it.

Mexico has only one nuclear power plant, an isolated project built by General Electric, already seven years behind its starting date.

One argument is that General Electric's foot in the door here; its training and experience here is a great advantage for U.S. technology. But another is that the poor performance of the Laguna Verde plant is a serious drawback. Mexicans and Americans blame each other for the false starts and the administrative chaos there.

There is another disadvantage for American contenders. Mexico insists on transfer of technology and total self-sufficiency in the long run. And it feels burned by the 1978 U.S. hold-up of enriched uranium for a small trainer reactor when the Carter administration insisted that the United States have the right to supervise uranium in Mexico.

Although Washington's stated policy is now one of eager cooperation, Mexico's naionalist sensitivities may have been hurt in this area beyond repair. Moreover, Mexico says, U.S., French and Swedish tecnology would leave Mexico dependent on enriched uranium, which can only be bought from the United States, China, Europe or the Soviet Union.

Canada and West Germany offer heavy water reactors in which Mexico can use its own considerable uranium reserves without enriching it abroad.

Leaving the door open to everyone, Mexican scientists have travelled abroad to study the merits of combining various types of technology.

Americans and Canadians here feel that the Europeans have an advantage when it comes to the key point of how to finance any deal.

"On this continent, competition is very stiff for us, especially from the Japanese, the French and the British. They all get help from their governments to offer heavily subsidized financing in a way that we don't," said one American businessman here. "Now Canada and the United States are slowly catching on to the idea."

The favorite financing story here at the moment involves British firm that last month won a vast contract for a government steel plant already believed to be in the pockets of the Japanese and the French.

The British company won the $636 million contract with a gesture no one else had matched: Included in the package was a British government grant amounting to 10 percent of the cost.

Talking about financing the massive nuclear projects here, one senior Mexican official conceded: "No doubt we'll see some fancy footwork when the bids come in." Mexico's reply, he said, was not likely to come until next August.