Let z be a point of Z. Because f : Z --> X is finite, then OZ,z is an OX,f(z)-algebra of the same dimension. By assumption, OY,z is an OZX,f(z)-algebra of relative dimension d.
By the theory of regular sequences (see the refernce in the comments), the sequence fi,z in OY,z, of stalks of the functions fi, is regular if the relative dimension of OY,z over OZ,z = OY,z/(fi,z) is equal to d. This is the case because of the assumptions. Therefor I conclude that the sequence is regular. This means that the embedding Z --> Y is a regular embedding. This implies that f : Z --> X is flat. Q.E.D.