The grant of every franchise for a street, suburban or interurban railroad, or any public carrier of passengers, shall provide that all United States mail carriers and all policemen and firemen of the city in uniform shall, at all times, while in the actual discharge of their duties, be allowed to ride on the passenger vehicles of any such aforementioned carrier within the boundaries of the city, without paying therefor, and with all rights of other passengers.