Pixelated silicon detectors are state-of-the-art technology to achieve precise tracking and vertexing at collider experiments, designed to accurately measure the hit position of incoming particles in high rate and radiation environments. The detector requirements become extremely demanding for operation at the High-Luminosity LHC, where up to 200 interactions will overlap in the same bunch crossing on top of the process of interest. Additionally, fluences up to 2.3 10^16 cm^-2 1 MeV neutron equivalent at 3.0 cm distance from the beam are expected for an integrated luminosity of 3000 fb^-1. In the last decades, the pixel pitch has constantly been reduced to cope with the experiments needs of achieving higher position resolution and maintaining low pixel occupancy per channel. The spatial resolution improves with a decreased pixel size but it degrades with radiation damage. Therefore, prototype sensor modules for the upgrade of the experiments at the HL-LHC need to be tested after being irradiated. This paper describes position resolution measurements on planar prototype sensors with 100x25 um^2 pixels for the CMS Phase-2 Upgrade. It reviews the dependence of the position resolution on the relative inclination angle between the incoming particle trajectory and the sensor, the charge threshold applied by the readout chip, and the bias voltage. A precision setup with three parallel planes of sensors has been used to investigate the performance of sensors irradiated to fluences up to F_eq = 3.6 10^15 cm-2. The measurements were performed with a 5 GeV electron beam. A spatial resolution of 3.2 +- 0.1 um is found for non-irradiated sensors, at the optimal angle for charge sharing. The resolution is 5.0 +/- 0.2 um for a proton-irradiated sensor at F_eq = 2.1 10^15 cm-2 and a neutron-irradiated sensor at F_eq = 3.6 10^15 cm^-2.