A federal judge ruled that Trump officials must testify under oath about the secretive Department of Government Efficiency in a suit filed by unions.