It's very possible to get good Pokenon without AR. In fact, it's simple.
THere are a couple of reasons why your friend beat you:
His levels were higher
YOur Pokemon choices were too weak
He was using legendaries
He EV trained
So, you might wanna learn EVs. Also, you need good natures, IVs, etc. I recommend you battle your friend on PO, so you can get any Poke you want and Ev train, get good natures, etc.