Probably from a Vulgar Latin *carrīlis, as an alteration of Late Latin currīlis, from Latin currus (“chariot”), with influence from carrus.
Practice speaking and memorizing "carril" and many other words and sentences in Catalan.