Cannot communicate on LAN when WIFI doesnt have internet
you cannot ping that device via Mobile Data.
You have Device 1 (yours) and Device 2 (device to be pinged).
Telling from the IPs given, both devices are on the same WiFi network. Device 1 can connect to Device 2 by requesting a ping to Device 2 on your router (Device 3).

Your router is most likely having the IP 192.168.1.1

As your router knows that you are connected to it, it will forward your ping request to Device 2 and back again.

When connected to your mobile carrier, you have a different IP. But, your router uses IPs to determine whether it knows a device or not. As you have a different IP and your ping request comes from the outside now, it does it's job: Not forwarding your ping requests. That's what the router is there for (besides establishing connections). It is a firewall and it's trying to prevent people from outside harming your devices.

When you are connected to WiFi


When you are connected to Mobile Service Data Provider


This means, that you are not actually having an Android Problem. What you need to do is to tell your router to forward PING packets. That's difficult. For that, you should head over to the Servers Fault community and ask them how you can do exactly that.

https://serverfault.com/