A Massachusetts judge and court officer accused of helping an illegal immigrant flee an Immigration and Customs Enforcement agent waiting to take him into custody were indicted Thursday by a federal grand jury for obstruction of justice and three other counts, officials said.