An office building in Washington, D.C., that counts city government groups as its anchor tenants sold to a real estate investment trust for nearly $119 million in a sign that well-leased properties can attract buyers even in a challenging sales market.