Norfolk & Western Railway Co. has sued Cox Enterprises in an attempt to enforce what it says is its right to buy back property in Portsmouth now slated as a construction site for an oil refinery and a major coal-shipping terminal.

The 623 acres on the Elizabeth River was sold by N&W to a Cox subsidiary six years ago for $3.2 million as the site for an oil refinery. Two weeks ago, Virginia Gov. John Dalton announced that an agreement in principle had been reached between Cox and three coal companies for construction of a coal-export terminal on a portion of the site. The pier is designed to relieve congestion in Hampton Roads, the nation's largest coal-exporting port, where scores of ships are often backed up waiting for dock space to load.

In a suit filed in the Virginia circuit court in Portsmouth, however, N&W laid claim to the land. N&W contended that a stipulation in the 1974 sales agreement between its subsidiary, Virginia Holding Corp., and Trailsend Land Co., a Cox subsidiary, allowed N&W to repurchase the property at the original $3.2 million price if construction on the refinery was not started by Oct. 17, 1980. "It is N&W's position that this obligation has not been met," the railroad said in a statement.

Although Cox -- through its subsidiary, Hampton Roads Energy Co. -- reportedly has started some work on the site, the N&W suit contends that Cox has not filed for a building permit for a refinery and its obligations have not been met. The N&W suit was filed following a demand from Trailsend that Virginia Holding execute a release of its repurchase rights. No one at Cox could be reached for comment yesterday.

N&W Chairman John P. Fishwick raised the question of ownership of the property after the Cox announcement was made two weeks ago, suggesting that N&W might build the facility itself.

The coal companies slated to participate in the building of the coal export facility are A.T. Massey Coal Co. of Richmond, a subsidiary of St. Joe Minerals Corp.; Consolidation Coal Co. of Pittsburgh; and Pittston Co. of Greenwich, Conn.

N&W also indicated that its land company also had exercised an option to repurchase from Transcontinental Gas Pipe Line Corp. 86 acres that adjoin the contested site. The 1973 deed for that property contained a similar obligation to be satisfied by Oct. 17, 1980.