Lie algebraic approach to the collinear collisions between two diatomic molecules