A 335i should average late 20s, an M3 low 20s.
Running costs of a 335i aren't too steep at all, 20k servicing, few hundred for discs and pads, tyres are reasonably common sizes. A later N55 engine'd one won't be a worry, as they've ironed out the N54's failings.
They are indeed very fast once played with, handle better than most others in class, but obviously not like an M3 and it has no diff.
Depreciation does hurt them, I'd look carefully at whether a dearer to run M3 may work out the same in the long run as its price bottoms out.
Maybe watch the episode of TopGear again with the AMG/RS4/M3.