Rain walloped the New York metropolitan area with a startling punch Friday, knocking out several subway and commuter rail lines, stranding drivers on highways, flooding basements and shuttering a terminal at LaGuardia Airport in one of the city’s wettest days in decades.