The Department of Justice is responsible for the administration of justice, appointment of judges, judicial infrastructure, legal aid, and matters related to courts and their administration in Union Territories. The Legislative Department is primarily responsible for drafting legislation and matters related to specific laws like the Administrators General and Official Trustees Act.