Not a physio but have good experience as I’ve been in and out of physio for last two years
More than likely it’s one of the adductor muscles – rest will help fix it but underlying condition will be that your anterior core (front half) is weak and it could go again. Q. can you touch your toes at all?
This worked for me when I had similar issues – depending on how close you can get your knees to the chest and stop them from parting when you breathe in might show you how weak your adductors are and doing this exercise regularly helped me a lot in getting the toe touch right
There may be other drivers for your pain – the pelvis is a big joint with a lot of movement and it could be anything that is causing the problem but hip flexors are more on the top and outside of the joint rather than internal to the groin