Of course it was illegal
When I didn't have a car I used to go to the work by bus. In that time, there was a group of students who used to take the same bus line that me. However, the bus conductor used to have a curious agreement with the students. On the travel to the school, he students used to give the travel money to the bus conductor. And on the travel to home, the bus conductor used to allow the students to travel for free. Of course it was illegal, but there were benefits for both students and bus conductor. It was not a surprise when the bus conductor was dismissed.