"principal line of a railway," 1841; meaning "affluent area of residence" is 1930s, originally that of Philadelphia, from the "main line" of the Pennsylvania Railroad which added local stops to a string of backwater towns west of the city late 19c. that helped turn them into fashionable suburbs.