When the hearse passed, people all took off their hats in salute.
Tips
usage
Maps cleanly onto the English idiom 'to take one's hat off to someone'. Used both literally (funerals, anthems) and figuratively in praise: 我对你脱帽致敬 = 'I tip my hat to you / massive respect'.
register
Formal/written. In casual speech, prefer 我服了 (I'm impressed) or 太厉害了. 脱帽致敬 in conversation sounds slightly elevated, the way 'I doff my cap' would in English.