Chandra and XMM-Newton resolved extremely long tails behind two middle-aged pulsars, J1509-5850 and J1740+1000. The tail of PSR J1509-5850 is discernible up to 5.6 from the pulsar (6.5 pc at a distance of 4 kpc), with a flux of 2*10^{-13} erg s^{-1} cm^{-2} in 0.5-8 keV. The tail spectrum fits an absorbed power-law (PL) model with the photon index of 2.3pm0.2, corresponding to the 0.5-8 keV luminosity of 1*10^{33} ergs s^{-1}, for n_H= 2.1*10^{22} cm^{-2}. The tail of PSR J1740+1000 is firmly detected up to 5 (2 pc at a 1.4 kpc distance), with a flux of 6*10^{-14} ergs cm^{-2} s^{-1} in 0.4-10 keV. The PL fit yields photon index of 1.4-1.5 and n_H=1*10^{21} cm^{-2}. The large extent of the tails suggests that the bulk flow in the tails starts as mildly relativistic downstream of the termination shock, and then gradually decelerates. Within the observed extent of the J1509-5850 tail, the average flow speed exceeds 5,000 km s^{-1}, and the equipartition magnetic field is a few times 10^{-5} G. For the J1740+1000 tail, the equipartition field is a factor of a few lower. The harder spectrum of the J1740+1000 tail implies either less efficient cooling or a harder spectrum of injected electrons. For the high-latitude PSR J1740+1000, the orientation of the tail on the sky shows that the pulsar is moving toward the Galactic plane, which means that it was born from a halo-star progenitor. The comparison between the J1509 and J1740 tails and the X-ray tails of other pulsars shows that the X-ray radiation efficiency correlates poorly with the pulsar spin-down luminosity or age. The X-ray efficiencies of the ram-pressure confined pulsar wind nebulae (PWNe) are systematically higher than those of PWNe around slowly moving pulsars with similar spin-down parameters.