Usually, there’re two different bridge shoes. One, where the bridge can move, and one where the bridge is fastened. This way the civil engineers can control the thermic movement of the bridge. For the rails there’re devices like the points at a turnout.
Wolfgang