The council may prescribe reasonable regulations for the running of cars, trains, and locomotives on, over, upon, or across the streets, avenues, alleys, or public places of the city or town. The council may prescribe appliances on grade crossings for the safety of the public and regulate and control the switching of cars on crossings or highways of the municipality.