Any railroad company having the right of way may run locomotives and cars by steam through cities and towns, at the rate of thirty miles an hour and no more. The company shall be liable for any damages or injury which may be sustained by any one from such locomotive or cars whilst they are running at a greater speed than thirty miles an hour through any city or town. The public service commission shall have power to fix and prescribe limits in cities and towns in which railroad companies may run locomotives and cars by steam at a greater rate than thirty miles an hour, and whenever it shall have fixed and prescribed such limits in any city or town this section shall not thereafter apply to the running of cars and locomotives by steam within the same.