A judge has ordered the foreclosure sale of the historic Riverton Houses, a middle-class Harlem apartment complex that plummeted in value amid the housing downturn. The decision by State Supreme Court Justice Richard Braun, released Tuesday, called for the auction of the gated community and its 1,232 apartments, which were built in the 1940s. With the property now valued at a fraction of the mortgage price, it appeared unlikely that the creditors that financed the $225 million deal would recoup all their losses.