Joint distributions of the maximum and the process for higher-order diffusions