Phillies rally to beat D-backs 4-2 in 10 innings