Upon written complaint authorized by the governing body of a city or county, by the board of supervisors of a town, or by authorized officers of a subject railroad, alleging that a railroad crossing a street, road, or highway in the city, town, or county is dangerous to life and property, and giving the reasons for the allegations, the commissioner shall investigate the matters contained in the complaint and, when necessary, initiate a hearing.