The hip flexors and the hamstrings do not perform comparable actions. For our purposes you can think of them as antagonistic. The hamstrings EXTEND the hip, for example standing up straight, deadlifting etc. The hip flexors FLEX the hip, for example bring the knees to the chest, situps etc.
When you squat, the action of the hip flexors will be to counteract the increasing tension of the hamstrings and glutes, to maintain spinal extension. Remember they are not directly assisting you to stand up with the weight. Contraction of the hamstrings and glutes will extend the hip, which along with extension of the knee, will return you to an upright position. The only contribution of the hip flexors in this case is maintaining a straight back. Indeed, the extent of this contribution is debatable; the lumbar extensors are more likely to be doing the bulk of the work in maintaining spinal extension.
If this isn't clear please refer to a textbook of anatomy for the functions and positions of the various muscles. Also remember that soreness in the anterior hip could be caused by other structures besides the hip flexors.