I felt pity for the dying birds.

Literal

Dying birds [object-を] pitifully thought.

瀕死の ('dying, near death') uses the formal compound 瀕死 as a noun modifier with の. 哀れに思う means 'to feel pity for' — 哀れに is the adverbial form of the na-adjective 哀れ ('pitiable'). The subject is omitted.