The House Judiciary Committee last night approved a major revision of the nation's immigration laws that includes controversial proposals to give major new rights to temporary foreign agricultural workers and to provide legal status quickly to large numbers of undocumented foreign farm workers.

The 25-to-10 vote by the committee breaks a bitter deadlock in the committee and keeps alive the possibility that Congress will complete action this year on immigration legislation after five years of struggle. The Senate completed action on an immigration bill last year.

But major obstacles to final approval of immigration overhaul remain. In the full House, both Republicans and Democrats have expressed reservations about the legislation, and the Senate version contains major differences. President Reagan has endorsed the Senate version but taken no stand on the House version.

The House version contains the major provisions adopted by the Senate. Both bills would establish a system of legal penalties against employers who knowingly hire illegal aliens for agricultural or nonagricultural work.

In addition, both would allow illegal aliens already in the United States the right to apply for legal status. The House provision would apply to aliens who could prove they have lived in the United States since Jan. 1, 1982. The Senate bill would require residence since Jan. 1, 1980.

But the House committee, in a controversial provision affecting only farm workers, agreed to provide legal "green card" status to any undocumented foreign farm worker who could prove he did 60 days of farm work in the United States between May 1, 1985 and May 1, 1986.

The Democratic amendment, proposed by Reps. Howard L. Berman (Calif.) and Charles E. Schumer (N.Y.), passed on a 19-to-16 vote split mostly along party lines.

The agricultural workers could retain their legal status even if they left farm work, and growers could later obtain "replenishment" workers, who could eventually obtain legal status.

Republicans argued that the provision would provide a magnet for illegal aliens, who would immediately become eligible for welfare benefits and would receive priority in bringing close relatives to the United States.

Even Rep. Romano L. Mazzoli (D-Ky.), who heads the immigration subcommittee, charged that the amendment would provide special treatment for agricultural interests that is "unparalleled, unprecedented and I find it unacceptable. . . it is a rolling legalization program. . . a rolling enticement to people to come in."

But proponents said the provision was part of a delicate compromise worked out by members between labor and growers to save the bill.

"For those who want an immigration bill, I suggest there is no other way," Berman said. "Otherwise everything begins to unravel. . . don't try to undo one part of the equation or the whole thing will come tumbling down."

Rep. Hamilton Fish Jr. (N.Y.), ranking Republican on the Judiciary Committee, was the only Republican to support the Schumer-Berman amendment. He said he was afraid the bill would die without it, leading to repressive action against illegal aliens.

Schumer defended the proposal to provide welfare coverage to newly legal farm workers: "Agriculture is a seasonal means of employment. . . . Are we going to tell people in the spring and winter months that they can't get food stamps?" But he added that farm workers are "used to working hard. The last thing they would want to do is to go on welfare."

An amendment by Mazzoli to deny welfare benefits to those workers was defeated, 17 to 17.

The Schumer-Berman amendment also contains provisions to revise and expand the "H-2" program that provides temporary foreign agricultural workers to U.S. growers.

A similar expansion is included in the Senate version, but the House bill would go further and give those temporary workers the right to free legal advice and would require growers to provide free housing for them. Growers now must provide only a housing allowance.

The Schumer-Berman amendment was intended to head off an agricultural guest-worker program included in the Senate bill that would allow up to 350,000 undocumented foreign farm workers into the country on a temporary basis at any one time.

Berman argued that it is unfair to maintain foreign farm workers as an underclass with no wage guarantees or legal rights, entirely at the mercy of their employers.

Judiciary Chairman Peter W. Rodino Jr. (D-N.J.) said he would attempt to kill any immigration bill with a guest-worker provision.

On the final vote, 15 Democrats and 10 Republicans supported the bill with seven Republicans and three Democrats opposing it.