The District section of an abandoned railroad spur along the Chesapeake and Ohio canal would become a hiker-biker trail under terms of an agreement being worked out between the Department of the Interior and the owners of the property.

Opening of the revamped right of way is still a few years off, but the agreement would make it unlikely that the Baltimore & Ohio Railroad strip, which extends about four miles, would be taken over for development or other nonrecreational uses.

Agreement to turn the right of way over to the National Park Service, a division of the Interior Department, is now "99 percent certain," a Park Service official said.

Details will be worked out this year or early in 1987 for a swap under which CSX, the B&O holding company that owns the property, will turn over the strip bordering the canal from the Maryland line near the Dalecarlia water works to Georgetown in exchange for an equivalent value of federally owned land, Interior Department officials said last week. The Park Service then will prepare a budget for con- verting the right of way to recre- ational uses, subject to congressional approval. The new park would open a year or two later, officials said.

The probable result would be a mixed-use path, open for hiking and biking along its entire length inside the District. A stretch of track at the Georgetown end may be preserved as a recreational feature.

One possibility would be to run handcars or old rail passenger equipment along the track "to give youngsters and oldsters a chance to relive the history of the railroad," a Park Service official said.

A Philadelphia firm, Seymour and Associates, has been retained by both parties to appraise the right of way, which CSX has been quoted as valuing at between $5 million and $10 million. The appraisal is to be submitted by September and negotiations will then begin in earnest.

The railroad, in exchange for its property, reportedly wants equivalent-value lands east of the Mississippi. The Interior Department and the General Services Administration will join in surveying potential swap sites, which could include government-owned warehouses, mineral rights on public lands and even offshore drilling rights. But no federal park land will be swapped.

In the meantime, the Interstate Commerce Commission is going ahead with its proceeding to determine whether and how the railroad should be allowed to abandon the spur line. At a June 18 hearing, testimony was taken from a number of local residents about disposal of the property.

While ICC is authorized to rule on abandonment of the line, the proceeding is largely a formality, since the line has in effect already been abandoned.

The B&O discontinued rail service more than a year ago, substituting trucks to deliver coal to a power plant under the Whitehurst Freeway in Georgetown.

The spur line at one time also carried bulk commodities, including grain and timber, to merchants, lumber yards and factories in Georgetown.

Demand for these products dwindled in the area, leaving only the coal traffic, which was not enough to keep the spur line going, company officials said.

The ICC will issue an outline of a proposed environmental impact statement later this summer. It will lay out alternative uses for the rail line and discuss the effect on the immediate area. Persons wishing to submit their views may do so by writing Robert Maestro, Room 3115, Interstate Commerce Commission, 1200 Constitution Ave. NW, Washington, D.C. 20423, mentioning Docket AB-19, Sub. 112.

But the forthcoming agreement between the railroad holding company and Interior could eliminate the need for this procedure.

The swap puts an end to prospects that Montgomery County and the District together might convert the right of way into a commuter rail line or highway.

The county government is still debating uses for the portion of track within its boundaries, including mass transit between Chevy Chase and Silver Spring Metro stops and some recreational use -- perhaps connected with the biker-hiker trail in the District.