@timothysir Try slightly longer, looser shorts. Those look a tad too fitted for running--totally fine for yoga or walking around, but heavy duty exercise like running will definitely cause tight shorts to ride up.
Edit: OP, try loose running shorts with built in underwear, that's the only type...