A balloon was caught in a tree.

Literal

Balloon [subject-が] tree [target-に] caught was.

引っかかっていた is the past progressive of 引っかかる (to get caught/snagged). ~ていた describes the resulting state: the balloon was in a state of being caught.