Even 3rd world countries can afford overhead wires but US cant, sup with that?
In the subway? Most of that infrastructure is well over a hundred years old. Renovating it to accommodate catenary wire would not only be massively costly (they'd have to re-bore every single tunnel), but would also increase maintenance requirements in a system which runs 24/7.
The commuter train systems which run outside of Manhattan use a variety of propulsion, depending on the line. Metro North, for instance, uses 750v third-rail on the Hudson line south of Croton with trains equipped with per-car propulsion. Trains which continue north of Croton to Poughkeepsie use dual-mode diesel locomotives supplying HEP to tractionless cars, switching to third-rail only upon entering the tunnel which leads to Grand Central. Trains on the New Haven Line are all-electric, using 750v third-rail power until Pelham and then switching to 12.5 kV overhead. They also keep a supply of diesel-only locomotives at the major deports both for maintenance work and as emergency propulsion for stranded trains should the power fail.
Here is a New Haven train running in overhead mode. The third-rail shoes are also visible near the bottom of each car:
NJTrans also uses a combination of all three, though I don't know the routes as well. Amtrak trains servicing Penn are equipped with dual-mode diesels similar to the Poughkeepsie trains on the other side, and for the same reason.