United Nations officials on Friday condemned the recent mass arrests of gay and transgender people in Azerbaijan, Egypt and Indonesia, saying that the authorities in those countries had violated international law by detaining, mistreating and torturing them.