The Justice Department said a federal judge had erred in not ordering Apple to unlock a drug dealer’s iPhone, in a case being watched by lawyers and experts on both sides of the encryption debate.