The victims were walking Saturday on the border of the Gravesend and Midwood neighborhoods when two cars collided and one veered into their path, the police said.