Results of inclusive measurements of inelastic electron and positron scattering from unpolarized protons and deuterons at the HERMES experiment are presented. The structure functions Fp2 and Fd2 are determined using a parameterization of existing data for the longitudinal-to-transverse virtual-photon absorption cross-section ratio. The HERMES results provide data in the ranges 0.006≤x≤0.9 and 0.1 GeV2≤Q2≤ 20 GeV2, covering the transition region between the perturbative and the non-perturbative regimes of QCD in a so-far largely unexplored kinematic region. They are in agreement with existing world data in the region of overlap. The measured cross sections are used, in combination with data from other experiments, to perform fits to the photon-nucleon cross section using the functional form of the ALLM model. The deuteron-to-proton cross-section ratio is also determined.