The United States and Canada resumed free trade talks yesterday, racing in a marathon session to meet a newly set deadline of midnight tonight for an agreement that would erase barriers to trade in goods, services and investment between the two nations.

The talks resumed after Treasury Secretary James A. Baker III broke a logjam that was keeping Canada from the bargaining table by offering, in a late Thursday night telephone call to Ottawa, a binding dispute-settlement mechanism that had been Prime Minister Brian Mulroney's major objective since he proposed a free trade pact 19 months ago.

While the new approach, worked out by Baker and U.S. trade officials, was enough to draw Canada to the negotiations, wide differences remained last night between the two countries on the issue. Administration officials also emphasized that Baker's proposal was contingent on major progress being made on a wide variety of U.S. trade concerns.

By nightfall, one official said that progress had not been made and major areas of U.S. concerns had not been addressed.

These U.S. concerns include a faster phasing out of Canadian tariffs, which are about twice as high as U.S. tariffs; greater guarantees of products protected by U.S. patents and trademarks from piracy in Canada; an end to programs allowing foreign auto makers duty-free entry to Canada for parts and components if they set up factories to export finished cars to the United States; a loosening of barriers to U.S. sales of telecommunications and services; a lowering of agricultural subsidies, and increased entry for U.S. beer, wine and liquor.

Administration sources also emphasized that the midnight deadline -- set after a check of the laws allowing speedy congressional action on the agreement -- is firm. Previously, they had said the deadline was midnight Sunday, but that President Reagan would not send a message to Capitol Hill, as required by law, that day.

In Ottawa, meanwhile, Washington Post correspondent Herbert H. Denton reported that a tired and drawn Mulroney acknowledged "important differences" in the talks over a free trade pact, the cornerstone of his economic policy, but said Canada's provincial premiers "remained fully supportive of {his government's} objectives and strategy."

Despite the long list of unsolved issues and a tight deadline, administration trade officials were more optimistic yesterday than they had had been since Canada's chief negotiator, Simon Reisman, walked out of the talks nine days ago. Reisman returned to Washington yesterday, resuming negotiations with his American counterpart, Peter Murphy.

The big difference, though, was that Canada had gotten its wish to have the talks elevated to the same high political plane here that they were in Ottawa. Running the negotiations from the Treasury Department were Baker, U.S. Trade Representative Clayton K. Yeutter and Deputy Treasury Secretary Peter McPherson for the United States, and Finance Minister Michael Wilson, Trade Minister Pat Carney and Derek Burney, chief of staff to Mulroney, for Canada.

While the chief negotiators and senior officials met at Treasury, more than a dozen groups of technical experts wrestled two blocks away at the U.S. Trade Representatives' office with the details of specific issues.

The dispute settlement issue still remained a major sticking point. Administration sources said the United States proposal would create a special tribunal with binding powers to review unfair trade complaints. But its authority would kick in only after trade complaints ran their normal course through U.S. and Canadian agencies, and would in effect replace U.S. and Canadian judicial review in trade cases.

The tribunal could only act, officials said, if a finding is inconsistent with the laws of the country that took the action.

Canada was reported to want a greater shield from U.S. law by giving the tribunal power over all stages of an unfair trade complaint. "They are not going to get that. No way is that going to happen," said a ranking administration official.

Key congressmen, nonetheless, expressed concerns that the United States had conceded too much to get Canada back to the talks without getting anything in return. Both Senate Finance Committee Chairman Lloyd Bentsen (D-Tex.) and House Ways and Means Committee Chairman Dan Rostenkowski (D-Ill.) were reported to have expressed those concerns to the administration yesterday.