I'm a UK National currently on a J1 visa as a student in the US which expires on July 13th (after the grace period) but my flight isn't booked until August 22nd as I want to do some more travelling around the US. Can I go to Mexico for around 10 days and then re-enter the US on an ESTA?
As long as you have your ESTA approved you should not have an issue. As per CBP you're not a subject to the 2 year home rule as long as you're not entering the US for the purpose of work or study.
So if you leave the country and then enter on an approved ESTA you should not have an issue.