Apple Maps cannot import GPX files. To view a trail or bike route on iPhone, use a dedicated GPX app.
What to use instead
Share the .gpx file to GPX Viewer from Mail, Files, or Safari. Full steps: open GPX on iPhone.
Related: View on a map · Offline viewing