I would think that the definition of habitable and habitation probably varies according to context.Perhaps guys working on a railway is not classed as habitation anyway.
I would imagine, for example, that there are probably regulations/laws relating to minimum standards./facilities for properties which are rented out as dwellings ('for living in') - and that might conceivably apply in the case of eric's 'workers', even if they are living 'rent-free'..
However, if one moves away from renting, I'm not convinced that (other perhaps in fairly extreme circumstances) anyone (or any 'body', or even 'the law') other than the owner of a building can dictate whether people are 'allowed' to 'live in' the building, no matter what facilities it has oor doesn't have. Mind you, I have to wonder whether things like 'fire regulations' might perhaps come into play?
Beach huts are perhaps an example, many/most of which have no electricity (or any other 'services'). The majority are owned by LAs (who charge 'Business Rates' for them!) and leased to users and, being the owners, the LAs often (usually, I think) have conditions in their Leases which prohibit 'overnight use'. However, a minority of such huts are owned (freehold) by the users and I suspect (but do not know for sure) that, in such a situation, they, as owners, can 'permit' themselves or others to 'live in' the hut. However, I'm not sure about any of that.
As with so many things, I suspect that if eric's workers were to 'live in' his hut/whatever, no-one would do anything to stop them (ieven if they became aware that it was happening). However, as also has been said, insurers may have something to say about this.
Kind Regards, John