The 2015 3 Series is a very boring car compared to the A5; however, it is rear wheel drive so does perform somewhat better in corners. I've driven all three cars many times and the A5 was the best. It looks nicer because its a sportback, has more curb appeal and is roomier. If you can afford about 15k per 5k KMs for maintenance then get the A5. Audi parts are significantly cheaper than ones for a BMW. Almost all parts at Dewan are on back order but you will not have issues for 3 Series part, though.
The A5 will definitely have more options like parking sensors and a sunroof which are rarely found on basic Dewan spec 316i/318is.
All in all, if you're purely after reliability and aesthetics then the A5 wins. If you want a bit more resale too then get the A4 which is positioned below the A5.
I've kept Mercedes over the years and would recommend you to get a 2010 E200 instead. Granted it costs a bit more and is heavier on maintenance, it is vastly better than any Audi or BMW. In general, Mercs have better resale in Pakistan