Hello,
The cause for the pain in your groin might be orchitis.
Ocrchitis is the inflammation of the testis and is usually bacterial in origin. Orchitis can cause pain in the groin especially if prolonged pressure is applied due to sleeping on your stomach. Moreover, most of the cases of asymptomatic with only paroxysmal symptoms. I suggest you do the following,
1) Avoid sleeping on your stomach as it can prevent the pressure on the groin. Also try to avoid hard mattress.
2 ) I suggest you get a routine urine analysis and culture ,to identify the causative organism. Based on the culture reports, the antibiotics can be changed later.
3) Take a prophylactic shot of Antibiotics Inj ceftriazone single dose or tab. Cefepime single dose for 7 days.
4) Maintain a good hygiene and practice safe sexual practice.
5) Drink plenty of water and maintain a good healthy diet.
If the pain is intermittent as you have mentioned then it will improve on antibiotics and rest but if the pain becomes continuous and does not subside, I suggest you contact a surgeon immediately and get a Doppler Ultrasonography to rule out Torsion of testis, which is a surgical emergency.
Thank you.