Delhi is a Modern Indian city with a population of about 15 million people. If you have been to Delhi, you must have noticed the amount of traffic in the city. Even though it is true that cows are worshiped in Hindu Mythology, they are an inconvenience for the flow of traffic. Over time they have been moved away from Delhi and now you won't find them on most roads. If you go into the village sections of Delhi, you will still find them in many households but this practice is also decreasing due to unavailability of grazing land. 15 years ago, Delhi had much more cows than now.
Agra is a relatively older city which is much less developed. It is not only smaller than Delhi but it more traditional that it. There is a good availability of grazing lands near Agra so you will still find many cows on the street even though they are an inconvenience to traffic.
Official removal efforts were also made in Delhi in order to prevent Cows and Buffalo within the city center. Conscious efforts by citizens were also made in order to prevent deaths of Cows. Traffic usually waits when cows are crossing roads as a mark of respect but every once in a while some lunatic crashes into one. It's simply a step into modernization and reducing inconveniences to both kinds of species.
Everything else apart, I was born and brought up in Delhi and have visited Agra several times as well. I truly cherish both cities and find that each has its own beauty. Hope this helps!