CHICAGO, SEPT. 23 -- About 15 months after the deal was first struck, Southwestern Bell Corp. received a judge's approval today to buy the cellular mobile telephone and paging operations of Metromedia Inc. -- including its stake in Washington and Baltimore mobile phone franchises.

When the $1.38 billion deal closes, which is expected within a week, the competition for cellular customers in several markets for the first time will be between two telephone companies, as St. Louis-based Southwestern Bell bumps heads with a local phone company in each of the markets it is entering.

Southwestern Bell is buying from Metromedia full ownership of the Chicago cellular system and majority stakes in systems in Gary, Ind., Boston, Worcester, Mass., Washington and Baltimore.

Southwestern earlier purchased the Washington Post Co.'s 20 percent interest in the local Cellular One system and has agreed to buy out the remaining investors in the Washington and Baltimore systems for $74.1 million, giving it full ownership of the service that competes with Bell Atlantic.

Metromedia also is selling Southwestern Bell paging systems in 29 markets, including Chicago, New York and Los Angeles.

In Washington, U.S. District Court Judge Harold Greene issued an order approving the deal, thus removing the last government obstacle to the sale. Greene gave Southwestern Bell six months after the sale closes to divest microwave interexchange facilities in Chicago, California and the District, and radio control links for some of its paging systems.

A Southwestern Bell spokesman said Greene's order would allow the company to lease those facilities back from parties that buy them.

The market for cellular systems has exploded since the Southwestern Bell-Metromedia deal was disclosed June 30, 1986.

Before the agreement was reached, cellular systems were selling for about $20 a "pop," which is a unit equal to a company's percentage ownership of a cellular system multiplied by the population of the local market. Some analysts have estimated that Southwestern Bell is paying about $41 a pop for the Metromedia cellular systems, a multiple considered high a year ago but cheap compared with some recent cellular sales at $70 or more a pop.

The transaction is expected to make Southwestern Bell the second-largest provider of cellular services in the country, trailing McCaw Communications Inc. With the 10 cellular systems it already owns and the Metromedia systems, Southwestern Bell will be in markets with a total population of 25.4 million and with about 120,000 cellular customers.

It also will among the leaders in paging services, with about 580,000 paging customers across the country.

The Federal Communications Commission originally required that there be only two cellular systems licensed in a market, with one system to be operated by a telephone, or "wireline," company, and the other by a nonwireline company.

The FCC no longer requires that a nonwireline company hold a cellular license in a market.