Walt Whitman died in 1892; the New York subway system did not open until 1904. Therefore, the poet could not have rendered any lines about "the subway car" in his poem, "Miracles." The line, "Or look at strangers opposite me riding in the car," obviously refers to the "car" on a train; Whitman's poem "To a Locomotive in Winter" is instructive here: https://poets.org/poem/locomotive-winter .
Whitman loved people; thus any of his lines, in any of his poems that refer to people, are filled with that love for his fellow citizens. The following lines from "Miracles" show Whitman's love of people as he demonstrates that the folks are included in his catalog of miracles:
Or whether I go among those I like best, and that like me best—mechanics, boatmen, farmers,
Or among the savans—or to the soiree—or to the opera,
Or stand a long while looking at the movements of machinery,
Or behold children at their sports,
Or the admirable sight of the perfect old man, or the perfect old woman,
Or the sick in hospitals, or the dead carried to burial,
Or my own eyes and figure in the glass;
These, with the rest, one and all, are to me miracles,
The whole referring—yet each distinct, and in its place.