From Latin rīvellus, diminutive of rīvus (“small stream”). In the “rail” sense a re-borrowing of Spanish riel.
Practice speaking and memorizing "riell" and many other words and sentences in Catalan.