The 16 low-income tenants of the Imperial Apartment Building in Adams-Morgan have agreed to move out Sept. 1 if the city government has not succeeded in buying the building by that date.

The unusual agreement, which ends a bitter two-year struggle between the tenants and owner George S. Dravillas, a well-known real estate agent and developer, calls for Dravillas to pay each tenant $10,000 if they must move.

The city intervened in the long-running dispute two months ago by making an unusual offer to buy the building at 1763 Columbia Rd. NW and convert its 36 units to public housing. The point of that effort, officials said then, was to prevent the tenants from being displaced.

The residents signed the agreement with Dravillas last week "to protect ourselves," according to tenants association president Casilda Luna. "We need a place to live and we hope we won't have to leave Adams-Morgan," she said, adding later: "If the city cannot buy it, at least we will have the $10,000."

The city's effort to buy the building appears to be making little headway.

Mayor Marion Barry asked federal officials in April for permission to use $3 million in unspent public housing funds to buy and renovate the Imperial. But the U.S. Department of Housing and Urban Development rejected that proposal because of Reagan budget policy that calls for unspent funds to be returned to the Treasury.

The city has now requested new federal funds, according to city housing official Marcus Dasher, whose office buys new housing properties.

Terry Chisholm, head of the local HUD office, said that at this point no public housing funds are available, but that his office is reviewing the request and hopes to make a recommendation on it by July 1.

Chisholm said that, while he has met with city housing officials about the Imperial proposal, he had not been told of the Sept. 1 deadline.

"If we were informed that there was a possibility that people could be displaced, we sure as hell would want to see if we could take those actions under our control that would prevent that displacement," he said.

Chisholm said that approving the city's request would require federal officials to waive two regulations, one prohibiting elevators in public housing for families, and the other requiring tenants to be admitted to new projects on a first-come, first-served basis.

The city's public housing waiting list now includes 7,000 families, some of whom have been waiting for as long as five years. Washington officials want to allow the Imperial's current tenants to remain, and to fill the 20 empty apartments from the waiting list.