A map service with related tables does not allow ArcGIS Online pop-ups to be configured when ArcGIS for Server is not externally available and is configured for integrated windows authentication (IWA).
When using IWA service it has to be added to Trusted Servers list in Edit Organization > Security > Trusted Server. Here is the Documentation link
https://doc.arcgis.com/en/arcgis-online/reference/arcgis-server-services.htm
https://doc.arcgis.com/en/arcgis-online/administer/configure-security.htm#ESRI_CHOICE_A6499281C8C34C9ABB4DF44E0848C3A0