The Southern Railway System and the Norfolk & Western Railway Co., two of the nation's most profitable railroad companies, announced yesterday a tentative agreement to merge.

The merger proposal would create a 17,500-mile eastern rail system stretching from Montreal, Buffalo and Detroit down to New Orleans and Florida and from the East Coast to Chicago, Omaha, Kansas City, St. Louis and Memphis.

Yesterday's surprise announcement came less than week after Southern Chairman L. Stanley Crane told stockholders at the annual meeting that Southern had no merger plans and was not discussing the possibility of one with anyone.

Officials of Southern and N&W, which held merger talks over a seven-month period last year before abandoning them without agreement in October, cited the "changed competitive situaton" as the principal factor leading to the new merger plan.

They cited both a continuing trend toward mergers in the railroad industry -- since the fall, mergers have been proposed between the Southern Pacific and the Santa Fe and between the Union Pacific and Missouri Pacific -- as well as a "changed deregulation climate."

Expected passage of legislation giving railroads more freedom to operate without government interference, "will make single-line operation, in our judgement, far more important," Southern Assistant Vice President William F. Geeslin said yesterday.

A combined Southern N&W would be able to compete more effectively against the merged Chessie System and Seaboard Coast Lines now awaiting approval from the Interstate Commerce Commission, company officials believe. a

As outlined yesterday, the 7,500-mile N&W and the 10,000-mile Southern would be consolidated under common ownership and control. The plan provides for the establishment of a new company which would acquire the two railroads in an exchange of stock valued at about $2 billion.

Holders of common shares of Southern would receive 1.9 shares in the new company for each share of existing Southern Railway common, and N&W holders would receive 1 share in the new company for each existing share in N&W common. At the close of business Friday, Southern's stock was selling for 59 1/2 while N&W was pegged at 31 1/8.

The plan is subject to a definitive agreement to be approved by the directors of both companies, by the stockholders of both companies and by the ICC.

The new company would be a "50-50 partnership," according to company officials with eight directors to be named by Southern and eight to be named by N&W. The directors will select the new chief executive.

The Washington-based Southern system serves 13 states primarily in the southeast. Its northernmost points are Washington and Cincinnati; its westernmost are St. Louis, Memphis and New Orleans.

The Norfolk and Western, headquartered in Roanoke, operates in 14 states and Canada; extends from Norfolk to Kansas City, Mo., and Omaha; and reaches Chicago, Detroit and Buffalo. In addition, the N&W has a 1,673-mile affiliate, the Delaware and Hudson Railway Co., that extends east from Buffalo.

The two rail systems connect at St. Louis; Cincinnati; Norfolk; Lynchburg; Durham, N.C.; Winston-Salem and Washington, D.C.

Both railroads are among the most profitable in the industry. Last year, N&W reported a profit of $198.6 million while Southern Reported a profit of $160.6 million.

Assuming the other pending mergers are approved, a consolidated Southern-N&W would create a system about the size of Conrail, with at least four rail systems larger.