It is a participle. You can tell this because it qualifies (describes) "they", the subject of the verb. Being a participle, it is a kind of adjective: a verbal adjective. that is, it is an adjective formed from a verb base - in this case, hear.

Now in the following sentence, hearing is a so-called gerund.

Hearing the sound was the most significant thing I experienced all day.

In this case hearing functions as a noun: a verbal noun. You can tell this because hearing is the subject of the main verb is. It could be the object of a verb.

I hate hearing the sound.

It is not always that easy, these are the simplest way to explain the difference between these two features.