The head of Mexico’s immigration agency was has appeared in court, on charges he failed to protect those in his custody after the deaths of 40 peole at a migrant detention center last month.