Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
This is my point. After the work of Manetti and Catanese and others we have simply connected topological manifolds with two complex structures that are not deformation equivalent. I would expect that their examples may be adapted to characteristic p to give a negative answer to your question, but I'm not an expert in finite characteristic issues.
I'm not sure what you mean by $Y$, but I think here you are wrong, this factorization is biregular. A bidouble cover $X \rightarrow Z$ can be factored as a composition of two double covers in three different way, say $X \rightarrow Y_i \rightarrow Z$: if $L_1,L_2,L_3,D_1,D_2,D_3$ are the building data of $X \rightarrow Z$, then $f_i \colon Y_i \rightarrow Z$ is the double cover branched on $D_j+D_k$ (here $\{i,j,k\}=\{1,2,3\}$) whereas the double cover $X \rightarrow Y_i$ is branched on the pull-back of $D_i$.