Car hits train after boom gates raised prematurely