George Whitesides, the former NASA chief of staff, defeated Representative Mike Garcia, a Republican, flipping a hotly contested seat in the northern suburbs of Los Angeles.