Circle him when he is not attacking. Use Steel assist (Mawile) to help you with your capturing (Make an energy ball, flick it, circle Rampardos for a while, flick again and repeat until time's up or you successfully captured Rampardos). Or you can use Ground assist (Numel) to shake the ground while capturing it.