The relatively cordial atmosphere at Friday's "border summit" between Presidents Reagan and Miguel de la Madrid reflected a trend toward warmer U.S.-Mexican relations that has been evident since last spring, according to diplomats and other analysts from both countries.

Two major developments last autumn have contributed to the warming of relations. First, Mexico scaled back its emphasis on trying to push the United States to reach an agreement with Nicaragua's leftist Sandinista government. Second, the U.S. administration scrapped its purely free-market approach to the Third World debt problem.

But the friendly tone of Friday's meeting could not conceal the persistence of fundamental differences between the two countries over Central America, Mexican domestic economic policies, and, to a lesser extent, narcotics trafficking. These disagreements will continue to simmer, and could boil over in the future, the analysts said.

"We should underline the positive aspects of U.S.-Mexican relations -- progress and accomplishments -- but we must also recognize their deficiencies and limitations," de la Madrid said in his toast to Reagan at a luncheon honoring the U.S. president in the dusty Mexican border city of Mexicali.

The four-hour meeting appears to have yielded no significant progress on any major issue between the two countries, but diplomats on both sides had played down any such expectations beforehand and stressed the routine nature of the meeting. The U.S. and Mexican presidents try to meet once a year, although scheduling conflicts prevented them from doing so in 1985.

"What is important is that they met. It focuses the attention of both bureaucracies on the issues and problems to be solved," a U.S. official said.

Since there were no concrete advances in the talks, attention focused on the generally positive climate.

"Each meeting seems more productive than the last," Reagan said in his toast to de la Madrid. Mexico's ambassador to Washington, Jorge Espinosa de los Reyes, said at a news conference after the talks, "Without doubt, it was a very cordial and very positive meeting."

Such comments were in contrast to the harsh exchanges of last February, when U.S.-Mexican relations reached their lowest point in years following the abduction and subsequent slaying of U.S. Drug Enforcement Administration agent Enrique Camarena Salazar in the Mexican city of Guadalajara. At that time, the United States brought cross-border traffic to a near standstill by staging vehicle-by-vehicle searches to pressure Mexican authorities to investigate the case.

A senior Mexican official said after Friday's meeting that relations with the United States have been improving steadily since the Camarena killing. The U.S. pressure led the Mexicans to arrest several suspected leading drug traffickers in connection with the killing, although none has yet been brought to trial.

U.S. officials praised the Mexican government for improvements in its commitment this year to fighting narcotics traffic. A senior U.S. administration official said, however, that there continues to be "a great deal of corruption" within the government that permits drug trafficking and that "there is no question that some of it goes to quite high levels."

A factor in the improvement in relations has been Mexico's recognition that it was not getting anywhere in its effort to persuade the United States to reach a negotiated settlement with Nicaragua. De la Madrid toned down his public criticisms of U.S. policy on Central America and reportedly devoted only a small percentage of time at the talks to the issue.

Except for Cuba, Mexico has been Nicaragua's closest friend in Latin America. In particular, the government here has defended Nicaraguan interests in meetings of the Contadora group, which is seeking a negotiated settlement of Central America's conflicts.

Foreign Secretary Bernardo Sepulveda said Friday that Mexico "reaffirmed in a very emphatic manner" the necessity of maintaining a dialogue in Central America. But the previously cited senior Mexican official acknowledged that "the spaces in which to proceed with peace initiatives are not generous." He attributed this to a "radicalization" of positions by both Nicaragua and the United States during the past year.

As a result, other Mexican officials said, the government focused more attention at this meeting on bilateral issues, particularly on economic ones. Mexico was encouraged to do so by the "Baker Plan," named for U.S. Treasury Secretary James A. Baker III.

The plan calls for the U.S. government to help persuade private banks and international lending institutions to make fresh loans to Third World debtors. In return, the debtors are to put their economic houses in order by trimming their government budget deficits, fighting inflation and promoting private investment.

The importance of the Baker plan, from Mexico's point of view, is that it recognizes that the U.S. government must lend a hand in managing the enormous foreign debt burdens of Mexico and other Third World countries, such as Brazil and Argentina. Prior to last autumn's announcement of the Baker plan, the U.S. administration had maintained that the debt problem was a matter for the debtors and their bankers to solve.