As long as $a<b$, the distribution of $Z:=Z_i$ does not depend on $a,b$. This follows because for $Y_k:=(X_k-a)/(b-a)$ we have $Y_k\overset{iid}\sim U[0,1]$ and
$Z_i=\dfrac{Y_{(i)}-Y_{(1)}}{Y_{(n)}-Y_{(1)}}$. So, without loss of generality, $a=0$ and $b=1$.
The pdf of $Z$ can be found using the transformation technique -- that is, the change of variables formula, here for triple integrals. Indeed, letting
$$U:=X_{(1)},\quad V:=X_{(i)},\quad W:=X_{(n)},$$
we have
$$V=S+(T-S)Z,\quad U=S,\quad W=T,$$
where $Z:=Z_i$ as before, $S:=U$, and $T:=W$. The joint pdf $f$ of the order statistics $U=X_{(1)},V=X_{(i)},W=X_{(n)}$ is given by
$$f(u,v,w)=\frac{n!}{(i-2)!(n-1-i)!}\,(v-u)^{i-2}(w-v)^{n-1-i}1(0<u<v<w<1)$$
for real $u,v,w$. The Jacobian determinant of the transformation $(z,s,t)\mapsto(u,v,w)$ that transforms $(Z,S,T)$ to $(U,V,W)=(S+(T-S)Z,S,T)$ is
$$\frac{\partial(u,v,w)}{\partial(z,s,t)}=s-t.$$
So, the joint pdf $g$ of $Z,S,T$ is given by
$$g(z,s,t)=|s-t| \\
\times\frac{n!}{(i-2)!(n-1-i)!}\,((t-s)z)^{i-2}((t-s)(1-z))^{n-1-i}
\\
\times 1(0<s<s+(t-s)z<t<1)\\
=(t-s)^{n-2} 1(0<s<t<1)\\
\times\frac{n!}{(i-2)!(n-1-i)!}\,z^{i-2}(1-z)^{n-1-i}
\\
\times 1(0<z<1)\\
$$
for real $z,s,t$.
Thus, $Z=Z_i$ (is independent of $(S,T)=(U,W)=(X_{(1)},X_{(n)})$ and) has the beta distribution with parameters $i-1,n-i$.