Molecular dynamics of the phase transition in ammonium chloride and deutero-ammonium chloride crystals at low temperatures