All cities and incorporated towns shall have the power to pass ordinances prohibiting persons from unlawful riding on cars within the limits of the city or incorporated town.