With the rise of movies then TV, you had more people seeing men on screen without hats. Why? Because it's difficult to properly light a man's face while he is wearing a hat. The lights must be somewhat above the actors, so a hat causes a shadow across his face. If you want to see the man's face, then he can't wear a hat on camera. So, once you have the trend setters removing hats, then people get more used to the idea of seeing a man's head sans chapeau. News anchors still dress nicely in suits, so they would still be somewhat formal, even without the hat.
If this were the case, it would probably start to show the decline of hats earlier than the rise of automobiles, in the 1930's or so, so this theory could be tested separately from the rise of the automobile.
I doubt this is the case: if you look at non US cinematography, hats had been strongly in decline already in movies from the 50s', and from a few mass events' pics I can google it seems hats were still common but not overwhelmingly so.
If Barack Obama decided tomorrow to stop wearing pants, would this become a new trend? Or would we be very quickly getting used to the words "President Biden"? The time is not ripe for Presidents to stop wearing pants.
On the other hand, Obama has frequently been photographed with a suit and no tie; as far as I know he's the first President to attempt that look. But it's been a fairly common look among youngish men for well over a decade.
Also popular with Monk from the eponymous tv series.
Then why did the change occur world wide where mass transport was still the major transportation source?
One word: Hollywood. If you check out the movies of the time in an eighteen month period men stopped wearing hats. Those American movies spread the fashion change world wide. Sorry, but Eisenhower had nothing to do with it.