In a battle for their place on the supermarket shelf, the makers of plastic and cardboard cartons both declared victory yesterday after a federal judge refused to stop a major advertising campaign against plastic milk containers but barred some of its claims as false.

The ad campaign, mounted by the Paperboard Packaging Council, a trade association, claims that milk in cardboard packages is more nutritious than milk in plastic containers because cardboard better blocks light that destroys important vitamins.

In a 36-page opinion, issued here late Friday after a seven-day trial, U.S. District Judge Thomas A. Flannery concluded that the paperboard group "can accurately claim that certain laboratory studies do in fact indicate that milk in plastic may be subject to greater vitamin losses than milk packaged in paperboard."

But Flannery said the ad campaign cannot attribute vitamin losses to the effect of light on all kinds of "milk" when such losses have actually been reported only for "skim milk." He added that the ads cannot cite laboratory studies on vitamin loss that do not attempt to duplicate retail display conditions.

Flannery said the paperboard group also made false statements about the number of studies that support its position and how recently they were conducted, but declined to take action because there was no showing they had affected consumers.

But he added that the Society of the Plastics Industry, which brought the suit, "is free to counter . . . claims with the contrary results of other scentific studies and the results of its own marketplace" research.

Late yesterday, Edward Iciek, president of the Paperboard Council, said anti-plastic ad campaigns would be mounted soon in Chicago and several other markets with only "minor changes" from ads run in the past. Since 1982, he said, the council has spent over $6 million on such advertising. He said it has succeeded in stopping a decade-long slide in cardboard milk carton sales.

However, John Dubeck, a lawyer for the plastics group, said the judge's order means that "they can't run the campaign the way they have in the past. They better be careful in explaining the data because a lot of what they've done is false and deceptive."

Since 1971, according to Flannery's opinion, the share of the milk container market accounted for by cardboard containers has slipped from 70 percent to 31 percent.

The Paperboard Council's ads say that milk loses both vitamin A and riboflavin when exposed to light through plastic packages.

One of their frequently mentioned points, accompanied in radio commercials by the sound of vitamins being destroyed, is that "in 24 hours milk in plastic can lose up to 14 percent of its . . . riboflavin."

But Flannery said that the Cornell University study on which this claim is based "reports a loss of 14 percent only for skim milk, which makes up only a very small portion (4.4 percent) of fluid milk sales." For whole milk, Flannery said, the study reports an 8 percent loss of riboflavin.

Of 62 studies cited in a Paperboard Council booklet, Flannery said only 29 actually test for vitamin content, while many of the others are literature reviews. He said expert witnesses for the plastics group testified that only three of the studies "actually attempted to duplicate conditions in the retail marketplace" and that for "some periods of exposure to light" these studies reported no difference between the vitamin content of milk in the two kinds of packages.

However, Flannery added that there is "general agreement among dairy scientists that there can be a loss of vitamin A . . . and riboflavin" in milk especially under the fluorescent lights of supermarket display cases. He said a majority of scientists at a National Dairy Council symposium said the "use of opaque containers, such as paperboard, is one of the most effective ways to prevent such losses."