Large planetesimals and planetary embryos ranging from several hundred to a few thousand kilometers can develop magma oceans through mutual collisions, gravitational energy, and the heating of short-lived radioactive elements. During their solidification after the dissipation of the disk a steam atmosphere will be catastrophically outgassed and may be lost efficiently via hydrodynamic escape, as long as it does not condense. The escaping H-atoms that originate from the dissociation of H2O and H2 will drag heavier trace elements like noble gases such as Ne and Ar and outgassed moderately volatile rock-forming elements such as K, Na, Si, Mg, etc. into space. Under consideration of various EUV flux evolution scenarios of young solar-type stars, we apply an upper atmosphere hydrodynamic escape model that includes the dragging of heavier species by escaping H-atoms. We investigate the atmospheric/elemental escape and fractionation from planetary embryos with masses of 1 MMoon, 0.5 MMars, 1 MMars, and 1.5 MMars at different orbital distances between the orbits of Venus and Mars. Our results indicate that the steam atmospheres and the embedded trace elements will be lost efficiently before they condense for masses ≤0.5 MMars and orbital distances up to 1 AU. For heavier embryos of up to 1.5 MMars almost all of the considered steam atmospheres can be lost within ≈12 Myr, which lies within the time frame of the formation of the first Martian protocrust after ≈20 Myr, i.e. for such steam atmospheres to be lost completely a shallow magma ocean must remain below the atmosphere, which might be achieved through frequent impacts onto the planetary embryo. The considered outgassed noble gases and rock-forming elements will be completely dragged away together with the steam atmospheres under the assumption that the trace elements will reach the thermosphere. For embryos with masses ≤MMoon the gravity is too weak for a dense atmosphere to build up for the high magma ocean related surface temperatures and all outgassed elements will escape immediately to space. For all considered planetary masses and orbits the loss rates of Ar and Ne are so high that there will be no fractionation of their isotopes. The studied planetary embryos, even though not isotopically fractionated, will therefore be severely depleted in noble gases and moderately volatile elements. Hydrodynamic escape might then also affect the final composition of terrestrial planets that accrete out of such planetary embryos, such as the volatile content and the Fe/Mg ratio of a planet.