Equivalence of inflationary models between the metric and Palatini formulation of scalar-tensor theories