The automasking is 3dDWItoDT is implemented as an automask of the first sub-brick, a B0 volume. The 3dAutomask program, on the other hand, computes the automask from the median of all sub-bricks in the dataset. To get the same result, you can specify the zeroth sub-brick on the command line.
3dAutomask -prefix dwi_am dwi+orig'[0]'