The Illinois Central Gulf Railroad announced yesterday that it will drop out of the rail corridor linking the Southeast and the Midwest, selling 200 miles of track to Norfolk Southern Corp.

Norfolk Southern and ICG agreed to a $38 million purchase of ICG's line from Haleyville, Ala., to Fulton, Ky., the core of the ICG route between St. Louis and Birmingham. Norfolk Southern also will be granted rights to operate its trains further north over the 154-mile ICG line from Fulton to Centralia, Ill., giving it a route between Birmingham and St. Louis hundreds of miles shorter than its current route via Louisville.

The sale must be approved by the boards of both railroads and by regulatory agencies.

The sale is the last step in a four-year ICG effort to get out of its east-west markets to concentrate on its Chicago-New Orleans main line.

The ICG has trimmed itself from a 9,600-mile web of lines to about 3,000 miles of line. It has made the cuts mostly by abandoning or selling routes to entrepreneurs who have formed new regional railroads or short lines. The sale of the Birmingham-St. Louis market is the first large sale to another major railroad.

"With the sale of our Birmingham line, the ICG will complete its program of building a more efficient core railroad," ICG Chairman Harry J. Bruce said in a statement.

Headquartered in Norfolk, Norfolk Southern operates about 17,500 miles of line throughout the Southeast and Midwest. It was formed from the consolidation of the Southern Railway System and the Norfolk & Western Railway.

For several years, Norfolk Southern has been attempting to expand its system.

It made a long but unsuccessful attempt to buy Conrail when the government sold the federally financed northeastern railroad last year. Norfolk Southern is reported to have more than $1 billion in cash that had been intended for the Conrail purchase. With a direct route from the St. Louis gateway to the center of its system in Birmingham, the Norfolk Southern would be in a stronger position if it decides to look westward for further purchases or mergers. A number of western railroads operate into St. Louis.

The Norfolk Southern considered buying the ICG several years ago, but rejected the idea, apparently because the ICG was in poor condition at that time. It was during that period that ICG chairman Bruce began his effort to cut the railroad back to a stronger Chicago-New Orleans core.

A Norfolk Southern spokesman said ICG employes who operate the line will be offered jobs on the new railroad. The line is fairly heavily used. In 1986, ICG handled 57,500 carloads over the line, generating $48 million in business.