@ysiegel What you can do in the Shortcuts app is an automation that runs when you leave your home.
This automation can run a shortcut.
This shortcut can end by sending a notification with the text you want.
Sure that all this runs when your locked screen is displayed.
Now, you have to find a way to get your train schedule via shortcuts actions, without Pythonista,
By example by posting a request to an api server and getting the result, what the Shortcut app allows.

If your Pythonista script is short, perhaps could you translate it into shortcut actions
For instance, suppose you have a table of schedules and you have to select one in function of current time.