What is the difference of lavatory from toilet?
In that passage, the speaker was referring to a class distinction in the usage of the words. He was saying, in essence, that an upper-class (hence upper-deck) Englishman would never use the crass word "toilet", he would always say lavatory (that's pronounced LAV-a-tree in British, LAV-a-Tor-ee in American). To use "toilet", in his view, marks one as being lower-class (lower decks).
This is clealy shown in that the more experienced one warns the novice that they might be "caught out"—that is, discovered to be lower class ("gangsters", as you call them) pretending to be upper class.
By the way, "lavatory" and "toilet" are NOT synonymous in AmE. The former means the room, and the latter means the fixture. In public venues such as schools or stadia, the room is sometimes called a lavatory, but in restaurants and other establishments it is usually called the restroom (a euphemism, clearly). At someone's home, it is the bathroom (also a euphemism).
But inAmE, only the fixture is called toilet. You would be considered a __yokel_ in most parts of the country if you asked to use the toilet. (Another euphemism, even more vague/abstract/demure, and not so common is use the facilities.)
It’s on the far side of the first–class lounge.
It is indeed a matter of social class. For the historical background to the passage in your question, you might like to read about "U" and "Non U" language in this Wikipedia article which also includes the particular example from your passage.
"U and non-U" was an entirely artificial construction of linguistic discrimination, based on the vocabulary choice of different classes in Britain,
with "U" standing for "upper class", and "non-U" representing the aspiring middle classes, [It] was part of the terminology of popular discourse of social dialects (sociolects) in Britain in the 1950s.
Wikipedia (above)
As you can see from the article, it was taken up and popularised by Nancy Mitford and provided much anxiety among the British middle class in the fifties. Although possibly disseminated at first as wry comment with rather satirical intent, the whole idea became one of great importance to some people.
As the article concludes:
Some of the terms and the ideas behind them were largely obsolete by the late 20th century, when, in the United Kingdom, reverse snobbery led younger members of the British upper and middle classes to adopt elements of working class speech (see: Estuary English and Mockney). Yet many, if not most, of the differences remain very much current, and therefore perfectly usable as class indicators.
as before
Toilet (Online Etymology Dictionary):
1530s, earliest in English in an obsolete sense "cover or bag for clothes," from Middle French toilette "a cloth; a bag for clothes," diminutive of toile "cloth, net" (see toil (n.2)). Toilet acquired an association with upper class dressing by 18c., through the specific sense "a fine cloth cover on the dressing table for the articles spread upon it;" thence "the articles, collectively, used in dressing" (mirror, bottles, brushes, combs, etc.). Subsequent sense evolution in English (mostly following French uses) is to "act or process of dressing," especially the dressing and powdering of the hair (1680s); then "a dressing room" (1819), especially one with a lavatory attached; then "lavatory or porcelain plumbing fixture" (1895), an American euphemistic use.
Lavatory (Online Etymology Dictionary):
late 14c., "washbasin," from Latin lavatorium "place for washing," noun use of neuter of adjective lavatorius "pertaining to washing," from lavatus, past participle of lavare "to wash" (see lave). Sense of "washroom" is first attested 1650s; as a euphemism for "toilet, W.C.," it is attested by 1864.
Latrine (Online Etymology Dictionary):
c. 1300, probably from Latin latrina, contraction of lavatrina "washbasin, washroom," from lavatus, past participle of lavare "to wash" (see lave) + -trina, suffix denoting "workplace." Its reappearance in 1640s is probably a re-borrowing from French; especially of a privy of a camp, barracks, college, hospital, etc. Latrine rumor "baseless gossip" (of the kind that spreads in conversations in latrines) is military slang, first recorded 1918.
Privy (n.) (Online Etymology Dictionary):
"toilet," c. 1200, from Old French privé, privee "latrine," literally "private place," from noun use of adjective privé (see privy (adj.)).
As can be seen, they're all essentially euphemisms. There are so many different ones because as soon as one term becomes common, it also becomes too "crude" for higher-class (ie, snootier) people to use, so another term must be invented.