It's better if there's air conditioning from within the unit, so the air pressure is greater inside your unit than outside; the air is being forced toward the windows. And, hopefully, that air isn't entering your unit smelling of unburnt hydrocarbons. If you have window units, unfortunately you're going to be pulling the air in. And while air conditioners do have filters, I haven't found any that are particularly good at filtering out fumes and smells. Most filters filter out larger particulates--soot, ash, etc. HEPA filters get the smaller particles...but you normally don't find HEPA filters on air conditioners. They're typically installed on HVAC units, and they're pretty expensive. Worse, from your standpoint, HEPA filters still are filtering particulates, not odors on a molecular level.
If you're thinking of purchasing an apartment on the 3rd floor, the best advice would be to go, visit that apartment when traffic outside is worst--maybe 8:30 am or 5:30 pm, or whatever is the peak of the traffic outside the apartment. Judge for yourself. It might be fine.