MAZATLAN, MEXICO, FEB. 13 -- The leaders of the United States and Mexico, meeting in the twilight of their presidencies, today hailed improvement of economic and law enforcement relations between their two nations while agreeing to disagree on Central America policy.

In their sixth and probably final meeting, President Reagan and Mexican President Miguel de la Madrid also said U.S. and Mexican authorities are now cooperating more effectively in the international effort to curb the flow of illicit drugs into the United States.

"Mexico emphatically ratifies its decision to combat drug trafficking, a cancer of contemporary society and a risk to national security, with the utmost energy," de la Madrid said in a luncheon speech.

Secretary of State George P. Shultz said afterward that drug enforcement issues had dominated the discussions of the presidents and added that neither Mexico nor the United States had done enough to control the illegal drug flow in the hemisphere. Attorney General Edwin Meese III acknowledged that the drug flow from Mexico into the United States may be increasing despite improved law enforcement efforts on both sides of the border, saying, "There's both progress and frustration."

Relations between the two presidents have in the past ranged from frigid to formal, but the public ceremonies today were cordial by previous standards. Both leaders stressed positive aspects of the U.S.-Mexican relationship, particularly trade, rather than continuing tensions on drug and immigration and disagreement on Nicaragua.

In his luncheon speech, de la Madrid cited "ample evidence of an improvement in the climate of our relations and substantial progress in dealing with a number of issues" on the U.S.-Mexican agenda. Welcoming the president at a ceremony near Mazatlan beach while schoolchildren waved American and Mexican flags, de la Madrid said Reagan had maintained relations with Mexico "within an atmosphere of mutual cordiality, dignity and respect."

Officials on both sides said the positive tone of the meeting reflected economic concerns and a desire of both presidents to conclude their personal meetings on a positive note. Reagan has 11 months remaining in office; de la Madrid's term is up in December but he will be a lame duck after a new president is elected July 6.

After years of deploring Third World debt and calling for greater austerity measures in this impoverished nation, the Reagan administration at the end of last year endorsed a Mexican plan to exchange up to $20 billion of its $105 billion debt for 20-year Mexican bonds collateralized by U.S. Treasury issues with the same maturity. In a luncheon speech, Reagan told de la Madrid that this was an "innovative, market-based solution."

The Mexicans want the Reagan administration to encourage American banks to purchase these bonds. De la Madrid warned in his speech that "foreign debt continues to be one of the major obstacles to development in my country."

Reagan, who has often talked of favoring a single North American common market, said the economies of the two nations are intertwined. Mexico is the fourth largest U.S. trading partner and its third largest supplier of crude oil. The United States is Mexico's largest trading partner.

"One thing that cannot be overemphasized is that a healthy and expanding Mexican economy is in the interest of the United States," Reagan said in his weekly radio speech.

Emphasizing the growing and more liberalized trade relationships between the two nations, U.S. trade representative Clayton Yeutter and Hector Hernandez, the Mexican minister of commerce and industry, signed a textile agreement that will allow an expanded quota for Mexican-manufactured clothing of fabrics cut and made in the United States. Mexico has been pressing hard for this provision, which should prove a boon to the maquiladora factories already flourishing in the border areas.

In addition, Reagan said that U.S. and Mexican negotiators were making progress on two other commercial agreements: a civil aviation pact that would expand flights to Mexican resorts and a telecommunications accord that would, among other things, establish frequencies for telephones on both sides of the border.

While the two leaders are pleased with the growing volume of U.S.-Mexican trade, Mexico also has the unenviable distinction of being one of the largest sources of cocaine and marijuana for the U.S. market. Reagan has in the past been critical of Mexican law enforcement that some U.S. officials have termed lax and corrupt.

Today, however, Reagan made a point of praising the "honest and concerned officials on both sides of the border," and paid tribute to Mexican and U.S. officers who had lost their lives in enforcing antidrug laws.

"We've been allies with brave individuals, men and women of integrity, who are putting their lives on the line against this evil, and the corruption and bloodshed that follows in its trail," Reagan said in the radio speech, taped in Washington on Thursday and broadcast today.

Fifteen Mexican state and federal security officers were killed last year while trying to enforce antidrug laws, most of them in shootouts with drug traffickers. Mazatlan is the largest city in the state of Sinaloa, a center of the drug trade, and a number of accused Sinaloa drug traffickers have been jailed in Mexico City for the kidnaping and murder three years ago of Enrique Camarena Salazar, an undercover agent of the U.S. Drug Enforcement Administration.

The torture and subsequent killing of Camarena remain "a sore spot" in U.S. law enforcement circles, a senior Reagan administration official said last week. Reagan's comments today were designed to express U.S. recognition that Mexican law enforcement officials are on the front line in the dangerous war against the drug trade.

U.S. officials said the president, in his private meeting with de la Madrid, said he recognized that Mexico was cooperating in the anti-drug fight but added, "this is the year we have to show results."

Figures supplied by the National Institute of Drug Abuse show that the amount of cocaine consumed in the United States has risen from 31 metric tons in 1981, the first year of the Reagan administration, to 71 metric tons in 1985, the last year for which complete figures were available.

De la Madrid, in his speech, reiterated the Mexican view that the United States must do more to discourage consumption.

Reagan and de la Madrid also exchanged familiar views on Central America. Reagan, who last week called for continued aid to the Nicaraguan rebels known as contras, told de la Madrid that he supports both the rebels and the Central American peace plan proposed by Costa Rican President Oscar Arias.

De la Madrid reiterated his longstanding support for a diplomatic solution to the Nicaraguan conflict, specifically backed the Arias plan and called for an end of aid to the contras.

Washington Post special correspondent William A. Orme, Jr., staff writer Stuart Auerbach and researcher Michelle Hall contributed to this report.