We study Diophantine equations of type f(x)=g(y), where both f and g have at least two distinct critical points and equal critical values at at most two distinct critical points. Some classical families of polynomials (f_n)_n are such that f_n satisfies these assumptions for all n. Our results cover and generalize several results in the literature on the finiteness of integral solutions to such equations. In doing so, we analyse the properties of the monodromy groups of such polynomials. We show that if f has coefficients in a field K, at least two distinct critical points and all distinct critical values, and char(K) is not a divisor of the degree of f, then the monodromy group of f is a doubly transitive permutation group. This is the same as saying that (f(x)-f(y))/(x-y) is irreducible over K. In particular, f cannot be represented as a composition of lower degree polynomials. We further show that if f has at least two distinct critical points and equal critical values at at most two of them, and if f(x)=g(h(x)), where g and h have coefficients in K and g is of degree at least 2, then either the degree of h is less or equal than 2, or f is of special type. In the latter case, in particular, f has no three simple critical points, nor five distinct critical points.