Who pays for flashing lights, gates, etc. at grade crossings?

Under Michigan law, those costs are shared equally by the railroad and road authority. Federal and/or state funds are available, however, for many projects.