The destruction of the building, once a palace for emperors that had fallen into disrepair, was an “incalculable loss for Brazil.”