Multiferroic YMn1-xFexO3(020) (x = 0.125, 0.25, 0.50) epitaxial thin films with an orthorhombic structure (space group Pbnm) were prepared on a YAlO3(010) substrate by pulsed-laser deposition. Upon Fe substitution, the b-axis was clearly shortened, whereas the a-and c-axes were slightly lengthened based on XRD analysis. To understand the influence of orbital polarization and the Jahn-Teller effect of Mn3+ on Fe substitution and also the local octahedral-site distortion of Fe3+ in an environment of Jahn-Teller-active Mn3+ ions in YMn1-xFexO3 films, we measured the polarization-dependent X-ray absorption spectra at the Mn-L-2,L-3 and Fe-L-2,L-3 edges, and also simulated the experimental spectra using configuration-interaction multiplet calculations. Although Delta e(g) for the Mn3+ ion decreased from 0.9 eV in pure YMnO3 to 0.6 eV in the half-Fe-substituted sample, a single eg electron was still strongly constrained to the d(3y2-r2) orbital for all the Fe concentrations tested. The largest Delta e(g), 0.5 eV, for the Fe3+ ion was derived for a sample with 12.5% Fe substitution, and gradually decreased to 0.15 eV for the half-Fe-substituted sample. The local octahedral-site distortion of the Fe3+ ion inside the YMnO3 lattice was similar to that of the Mn3+ ion, whereas the Jahn-Teller distortion and GdFeO3-type distortion of the Mn3+ ion were decreased by the spherical high-spin Fe3+ ions. The combination of the experimental and theoretical data provides both profound insight into the variation of the Jahn-Teller distortion and orbital anisotropy and instructive information about the magnetic structures in these orthorhombic YMn1-xFexO3 thin films.