Eight people were taken to hospital after the roof of a double-decker bus was torn off when it hit a railway bridge, police have said.