A federal judge in Raleigh, N.C., yesterday authorized a Department of Health, Education and Welfare trial on whether to cut off $90 million a year to the University of North Carolina for failure to abolish segregation completely.

But Judge Franklin T. Dupree ruled that until the trial ends, which could take years, HEW Secretary Joseph A. Califano Jr. may not defer $10 million to $20 million a year of the HEW money for the university system.

Politically, the judge's ruling could end up to be a boon to Califano and President Carter by delaying any cutoff of funds well past the 1980 election. Califano's antismoking campaign has angered many in tobacco-growing North Carolina, and cutting off funds for the university could further inflame this feeling.

Dupree rejected contentions by the 16-unit University of North Carolina system that HEW demands constitute unwarranted and unconstitutional intrusion into the state educational rights.

The department wants the school to devote more of its budget, and make other changes, to help draw white students into the six traditionally black colleges in the system.

Dupree's ruling is the latest step in a dispute spanning the decade. As a result of a lawsuit brought by the NAACP Legal Defense Fund, HEW was ordered to cut off funds to several southern states until they drafted acceptable plans to end segregation fully. Plans have been negotiated with all systems except UNC.

The university went to court to block the HEW trial and hold up funds. Dupree ruled the trial could go ahead but there could be no defferals pending its outcome.

In a statement Califano said "the decision . . . is a significant victory for the Department of HEW and the cause of equal opportunity for all students in the University of North Carolina system. . . .

"The court today refused to enjoin the administrative proceeding [trial] brought by the department against the university. The department will move promptly in this proceeding.

"I still believe it is preferable to settle civil rights cases without protracted litigation . . . And I am prepared at any time to resume discussions with Gov. [James] Hunt and [UNC] President [William] Friday."