If we approximate the accelerated path from $A$ to $B$, by $n$ "inertial" steps:
$A$ to $A_1$, $A_1$ to $A_2$,..., $A_{n-1}$ to $B$:
$t_{A-A_1}' = \gamma_1 (t_1 - v_1 \Delta x_1)$
$t_{A_1-A_2}' = \gamma_2 (t_2 - v_2 \Delta x_2)$
.
.
.
$t_{A_{n-1}-B}' = \gamma_n (t_n - v_n \Delta x_n)$
where $t_k$ is the time from $A_{k-1}$ to $A_{k}$ measured by the inertial frame, $\Delta x_k$ is the coordinate difference $x_{k} - x_{k-1}$ , measured also by the inertial frame. And $v_k$ is the speed of each step.
Adding the times:
$t_{A-B}' = \Sigma \gamma_k t_k - \Sigma \gamma_k v_k \Delta x_k$
But: $\Delta x_k = v_kt_k$
$t_{A-B}' = \Sigma \gamma_k t_k - \Sigma \gamma_k v_k^2 t_k = \Sigma \gamma_k t_k (1 - v_k^2) = \Sigma \frac {t_k}{\gamma_k}$
As $t_{A-B} = \Sigma t_k$ => $t_{A-B} > \Sigma \frac {t_k}{\gamma_k}$$t_{A-B} = \Sigma t_k\implies t_{A-B} > \Sigma \frac {t_k}{\gamma_k}$
$t_{A-B} > t_{A-B}'$
The accelerated path is the limit when the time of each step go to zero and the number of steps go to infinity.