The diagnostics of X-ray beam properties has a critical importance at the European X-ray Free-Electron Laser facility. Besides existing diagnostic components, utilization of a diamond sensor was proposed to achieve radiation-hard, non-invasive beam position and pulse energy measurements for hard X-rays. In particular, with very hard X-rays, diamond-based sensors become a useful complement to gas-based devices which lose sensitivity due to significantly reduced gas cross-sections. The measurements presented in this work were performed with diamond sensors consisting of an electronic-grade single-crystal chemical-vapor-deposition diamond with position-sensitive resistive electrodes in a duo-lateral configuration. The results show that the diamond sensor delivers pulse-resolved X-ray beam position data at 2.25 MHz with an uncertainty of less than 1% of the beam size. To our knowledge this is the first demonstration of pulse-resolved position measurements at the MHz rate using a transmissive diamond sensor at a free-electron laser facility. It can therefore be a valuable tool for X-ray free-electron lasers, especially for high-repetition-rate machines, enabling applications such as beam-based alignment and intra-pulse-train position feedback.