The Union Carbide Corp. and the Justice Department have agreed to a consent agreement, under which the nation's second largest chemical company said it will not restrain the sale of its patented carbaryl insecticides for 10 years.

The proposed settlement, announced yesterday by Attorney General Griffin B. Bell, would bring to a conclusion an antitrust suit filed last year. Justice's antitrust division had alleged that Union Carbide was illegally restricting sales of the insecticides, partially through use of duplicative patents.

After the suit was filed, Carbide disclaimed rights under a later patent, thus eliminating the "double patentin" situation. By using the patents, the government said, Carbide prevented, wholesale purchasers from selling carbaryl in its pure form or mixing it with any other compounds not specified by the chemical firm.

Carbide also agreed yesterday to sell the pure carbaryl to pesticide formulators for up to five years and to assist them, if requested, in obtaining necessary approval of their products from the Environmental Protection Agency. Carbide's carbaryl products have annual sales of $18 million and are marketed under the "Sevin" trade name, Justice said.

The proposed consent agreement must be approved by U.S. District Court in San Francisco.