I was tossing up between the two cars as well. After speaking with my mechanic it all seemed to come down to a personal choice.

The M3 is more of a passion car and will cost that little extra to maintain / insure etc. However if you can get your hands on an unmolestered manual (not SMG) they are still a very reliable car to have for the short and long term.
The 335 is, of course, newer and is more of a tuners car. Yes it is not as special as the M3 but it is still a very fun and powerful beast (from what I have heard).

From my research I have found that the M3 is as much a reliable and fast car as the 335, only the 335 is newer. The main benefit of the 335 is that it is easier to find a lower milage, later model example which is more likely to last the longer term.

If I were to buy tomorrow it would be more a case of which ever popped up first as they are both a great car which both have their positives and negatives.

If you are more of a purist and would regret not buying an M3, get the M3.