It was so quiet we could hear if anyone came along the trail.
This is understandable as it stands, but I think the intended meaning is better expressed in a different way:
It was so quiet (that) [we would have been able to hear (=could have heard) / would have heard] anyone [who came / who was coming / coming] along the trail.
Compare this with a commonly made remark:
It was so quiet you could have heard a pin drop. << This is the more idiomatic one.
(Not It was so quiet you could hear if a pin dropped.)
CJ