A two‐layer inviscid incompressible fluid system of intermediate depth is considered. A multiple‐scales perturbation technique is applied to the basic equations and boundary conditions for a two‐layer fluid system to derive a system of weakly nonlinear partial integrodifferential equations governing the resonant interaction between a surface gravity wave packet and an internal gravity wave at an intermediate depth, providing a bridge between the existing shallow and deep fluid theories. The convolution integral term in these equations accounts for the dispersion in the lower‐layer fluid. An iterative fast Fourier transform scheme is developed to find solitary wave solutions to this system of equations. The overtaking collision of two pairs of solitary waves, simulated using a spectral method, is found to be inelastic. It is found that the amplitude of the solitary waves changes slightly after the collision. The phase shifts these solitary waves undergo was calculated numerically.