If you have little control over the network from using the mobile access point, you can create a script to check the wlan you are connected to and set a route by putting the script in /usr/lib/dhcpcd/dhcpcd-hooks/
You can get the connected network from
and the set the IP address etc within this script. In my mind, this is a little messy but very flexible.
One other way would need a network with only the Pi and the access point on it (unless you can make sure any other device does not get ANY possible gateway address) by using the arping option in dhcpcd.conf. This example assumes the first gateway is on .1 and the other one being on .254 and no other device can occupy these addresses and in both cases the Pi needs to have the IP address of .44
The last way would be a mix. Set the static IP in dhcpcd.conf and use the hook to set up the route etc but this is so messy I'm loathe to go further with it :)
TBH, if my mobile network was requiring this level of complex control I would look to use a Pi as an access point giving you more control over DNS and DHCP or look to a router with a 3G/4G option that can have static addresses set up in it. TP-Link and Draytek have a few Options that can be used (I have seen both in action on building sites and small temporary warehouse / office cabins) but I'm sure others do them (e.g. Cisco).