A tower block in Sao Paulo, Brazil, has collapsed after a fire raged through the building, trapping people in the higher floors and spreading to another structure nearby.