Wikipedia says mass-produced sunglasses were introduced in the US in 1929. Umbrellas have been used to keep off rain since at least the 18th century. Both of these times are significantly earlier than the decline of the hat in America.
I find a hat better for dealing with the rain, but that could be because I'm in the Puget Sound area. We get a lot of rainy days, but it is usually not heavy rain. The annoyance if getting my clothes a little wet is less than the annoyance of having to hold an umbrella.
The only part of a light rain that is really annoying is wet glasses, and a hat deals with that nicely.
Yeah, I started wearing a hat a lot more when I moved to Seattle. It almost never rains hard enough for an umbrella, but it often drizzles hard enough for a hat.
Don't me wrong, I like a good hat. But there are less exciting reasons why people stopped wearing them.