Probably depends on the construction of the roof and windows. At least on European trains I've never had an issue getting GPS (unless you are in a tunnel or subway system). It takes a bit longer to get the first fix if you don't have AGPS, but no worse than in a car. Same with planes. On the other hand in a building it it pretty much only works next to a window, and malls don't have windows
https://github.com/denysvitali/where-am-i
Tbh, I think this geolocation method is amazing, and I'm grateful it exists, because GPS indoor really sucks.