MCI Communications Corp. and the CSX Corp. announced yesterday that they have signed a $32 million deal that will allow the long-distance telephone firm to lay fiber-optic cables along 4,000 miles of the railroad's right of way.

MCI officials said it is the largest fiber-optic system being proposed by any firm. AT&T is building a fiber-optic line from Richmond to Boston.

The venture announced yesterday will allow MCI to quadruple the long-distance circuits between the major cities to be served along the route. The agreement allows MCI to use any 4,000 miles along the CSX's 27,000 miles of right of way. The right of way covers a large area generally east of the Mississippi and south of Chicago. MCI Senior Vice President Howard Crane said that the company mainly will use the right of way to connect pairs of cities between which there is a lot of telephone traffic. That would include most of the major cities along the route such as Miami, New Orleans, Atlanta, Washington and others.

The 4,000 miles will not necessarily be contiguous, Crane said.

Ultimately the system along the CSX right of way is expected to be connected to another system along Amtrak's rail lines between Washington and New York, Crane said. MCI and Amtrak reached an agreement earlier this month to allow MCI to use that right of way, for which MCI paid $4.4 million for a little more than 200 miles.

Crane said that MCI expects to have completed construction by the end of 1987.

MCI currently relies on microwave transmissions to serve the Northeast and other sections of the country. The acquisition of rights of way along Amtrak and the CSX roads will save the company considerable amounts of money that it would have to spend to acquire its own right of way.

A fiber-optic system transmits computer data and telephone conversations via pulses of infrared light. The light is generated by laser diodes, small electricity generating devices, and carried along thin strands of silicon-coated, ultra-pure glass bundled into cables.