A Fairfax, Virginia, office building has sold for the second time in two years for a rare profit at a time when elevated borrowing costs, high vacancy and nonexistent rent growth have led to deeply discounted office sales in the Washington, D.C., area.