It's pretty cheap to have soil samples tested, but it winds up just confirming what you expect - our NYC backyard had 18x the upper limit for lead! Definitely raised beds.
If you want to reduce traffic and co2 further while increasing livable, walkable space in dense urban areas - then that can be accomplished by reducing the width of the roads.
The traffic comes from the fact that every family not living in the city, but living near it, ends up commuting there anyway.