All towns or cities shall have the power to regulate the running of railroad trains or engines or automobiles within the corporate boundaries, and to prohibit the standing thereof on or across the streets or highways within the corporate boundaries.