A building collapse in inner Sydney has left two men seriously injured and taken to hospital.