Every municipality shall have power to enter into and perform contracts with any railroad company for the separation of grades where any railroad crosses any street or highway at grade.