cloth simulation penetrates thorugh the collider
Setting up the pants as Cloth, acticating its ClothCollision and setting the legs as Collision, it should work immediately. Note that the pants can still penetrate at some spots if


resolution of your pants is too low
forces (e.g. sewing) are too high
cloth collision distance is set too low
they intersect at the beginning of the calculation already