Any railroad or railway company owning or operating within this state any line or branch of railroad connecting with any main line of railroad by means of a switch shall provide such switch with a reflector signal or with a suitable light such as is commonly used for such purposes and, if a light is provided, shall keep the same lighted from sunset on each and every calendar day of the year until sunrise on the following day.