Towards event-by-event mass composition tagging of ultra-high-energy cosmic rays using machine learning and Surface Detector data from the Pierre Auger Observatory and AugerPrime