Our text here goes further:
Rab Judah said in Rab's name: If an animal falls into a dyke, one brings pillows and bedding and places [them] under it, and if it ascends it ascends.
That is, in instances where it is not possible to bring food, we construct an ad hoc ramp out of pillows and bedding. But this presents another problem – since the bedding materials cannot then be pulled out until after the Shabbat ends, they are deprived of their use which is also forbidden on Shabbat!
But, the text continues:
[The avoidance of] suffering of dumb animals is a Biblical [law] (d’orita), so the Biblical law comes and supersedes the [interdict] of the Rabbis
This is quite remarkable, actually. Tzar baali chayyim is implied, but not expressed outright in the Torah. Yet the rabbis set it as a higher value than their own enactments.
At a time when the prevention of cruelty to animals was likely quite an uncommon consideration, the rabbis set it as a Divine command!