If a funeral, then perhaps the hats were placed back on their heads after the hearse had passed. In the 1950's I stood beside my father in a large crowd as a funeral procession passed. All the hatted men took their hats off, most put them back on after the hearse had passed. My father kept his hat over his heart until the entire procession had passed. When I asked him why, he explained, it was "his way, taught to him by his Dad", and the others paid their respects "their way", but we had all "paid our respects" in the right way for each of us.
I can see at least one man with his hat held across his heart. He is standing on the fence outside the churchyard, not much hair on top, and there are men in the procession not wearing any hat... To me the lack of hats on some in the procession that also is pointing to the photo being into the 1930's rather than soon after WWI .
Cheers, JM