Does Thassa, God of the Sea's "devotion to blue" clause count when it's not in play?
Based on the information you presented, it only functions on the battlefield. Even with no devotion to blue, it's a valid target for Lotleth Troll and Corpse Hauler.



The ability would only function outside of the battlefield if it was a characteristic-defining ability. For example, Ghostfire is colorless in all zones and even when deck building.


  604.3. Some static abilities are characteristic-defining abilities. A characteristic-defining ability conveys information about an object’s characteristics that would normally be found elsewhere on that object (such as in its mana cost, type line, or power/toughness box). Characteristic-defining abilities function in all zones. They also function outside the game.


However, it fails to meet two of six1 criteria for a characteristic-defining ability. 


  604.3a A static ability is a characteristic-defining ability if it meets the following criteria: (1) It defines an object’s colors, subtypes, power, or toughness; (2) it is printed on the card it affects, it was granted to the token it affects by the effect that created the token, or it was acquired by the object it affects as the result of a copy effect or text-changing effect; (3) it does not directly affect the characteristics of any other objects; (4) it is not an ability that an object grants to itself; and (5) it does not set the values of such characteristics only if certain conditions are met.



(1) It defines a characteristic other than the object's colors, subtypes, power and toughness.
(5) It sets the characteristic only if certain conditions are met.





The sixth is that it must be a static ability.