The alcohol details are ghastly, apparently from first-hand experience (it's not much surprise that Yerofeyev died of throat cancer in 1990), but Moskva-Petushki caught my interest when I ran into it from a rather geeky direction - Googling "trains in literature". This led to a litcrit paper, Where Did Venička Live? Some Observations on the World of V. Erofeev's Poėma Moskva — Petuški (Joost van Baak, Russian literature, Volume 54, Issues 1-3, 1 July 2003-1 October 2003, Pages 43-65) whose author has some interesting observations on the role of trains in literature.
Although the train as a mobile setting and conflict space can generate certain traditional mobile plot features (which it has in common with coaches, and the like), it is, no doubt, a modem literary setting, technically, and in the perspective of literary history.
As a plot-generating device and conflict space the train primarily motivates movement, and the accidental meeting between people.
Trains can also act as instruments of fate, and the first example from Russian literature that comes to mind is, of course, Tolstoj’s Anna Karenina, in which fatal train accidents ... literally frame the doomed heroine’s plot.
Trains and stations can function as “improper” houses, as partial (and defective) substitutes for the domestic qualities of the house in the proper sense. Often this function of the train is connected with the disruptions and peregrinations that come with war, as in Babel’s Konarmija, or in Pastemak’s Doctor Zhivago.
It's not difficult to think of other classic examples of novels and stories that feature trains centrally: Nesbit's The Railway Children, Dickens' The Signalman, Émile Zola's La Bête Humaine, a psychological murder thriller set again the backdrop of the Paris-Le Havre railway, and Christie's Murder on the Orient Express.
Certainly in early-mid Victorian England, the railway was cutting-edge technology driving, and driven by, major social change, and so it's unsurprising that it turns up a lot in fiction of that period. The Victorian Web's Victorian Railways and their Predecessors page links to a number of essays, led by this introduction, on the role of railways in Victorian literature, finding apart from plot devices, three chief themes: "their destructive effects on the city, particularly on housing for the poor, their cutting up the English landscape, and their involvement with greed, swindling, stock fraud and the Railroad Mania". Elizabeth Gaskell's Cranford, for instance, is set against the social upheaval caused by the impending arrival of the railway in a small Cheshire town.
There was an added edge for the Victorians: the overall mix of jolting travel, risk of accident, and social anxieties came together in the syndrome of "railway spine". Marked by chronic back pain, anxiety and other symptoms in passengers, whether public or rail workers, who had been involved in rail accidents, it usually appeared weeks or months after the accident, and was the subject of hot debate. Was it physical, as first thought, a delayed reaction to 'concussion to the spine'? A type of 'neurasthenia'? A con to get compensation? None of these: in hindsight, it can be viewed as a Victorian equivalent of Post-Traumatic Stress Disorder. The railway accident: trains, trauma and technological crisis in nineteenth-century Britain by Dr Ralph Harrington, and The Derailment of Railway Spine by Milton L Cohen and John L Quintner go into the details. Harrington's paper is largely about the historical context for Railway Spine: a culture gripped by fears of train accidents and social change; Cohen and Quintner's explores the changing medical view in relation to similar modern syndromes such as post-traumatic fibromyalgia. Nicholas Daly, in Literature, Technology, and Modernity, 1860-2000: 1860 - 2000 (CUP, 2004, ISBN:0521833922) - see Sensation fiction and the modernization of the senses - argues that the general Victorian fixation on the shock of railway accidents was one of the driving factors behind literature with a growing focus on surprise and sensation.
'The lost idea of a train': Looking for Britain's railway novel (Journal of Transport History, The, Sep 2000 by Carter, Ian) takes a broader view of the theme, with an exhaustive discussion of other examples of works featuring trains such as Dombey and Son and Howard's End, examining railway historians' claim that Britain has no major railway-based novels of the stature of the Tolstoy and Zola examples. One should, by the way, distinguish novels about railways from the genre called "railway novels"; cheap pocket-sized book editions - also called yellowbacks - sold at railway station stalls and designed for reading on a train (the "airport novels" of their day).
In the 20th century, the railway no longer being new technology, the thrust of its fictional role moved more into the plot mechanism / fateful journey slot described by van Baak, and this continued into the cinematic genre. Again, examples are easy to think of: Buster Keaton's The General; Patricia Highsmith's Strangers on a Train and its Hitchcock adaptation; the classic The Train (whose progress can be seen as allegory for the waning power of Nazi Germany at the end of WW2); Dr Terror's House of Horrors (mismatched characters carried towards their doom); Northwest Frontier, whose train passengers are a microcosm of the conflicts of India in the final days of the Raj; The Cassandra Crossing; Robbe-Grillet's Trans-Europ Express, a fairly strange erotic-psychological-experimental story set aboard a train; Horror Express; Runaway train; Death Train; Sliding Doors (where catching vs. failing to catch a train is the fateful dividing point for two timelines); and The Last Train (where a train is the vehicle that takes a mismatched group into a post-apocalyptic future). See Wikipedia's Rail transport in fiction list for other examples.
Even now, railways make rich settings for fiction. As shown by recent examples such as Andrew Martin's murder mystery The Necropolis Railway (see here for background), Michel Thaler's Le Train de Nulle Part (The Train From Nowhere), written with no verbs, and the first-mentioned Moskva-Petushki, the genre shows no signs of running out of steam. Maybe the Great British Railway Novel is yet to be written.
For further reading, check out the National Railway Museum's Moving Stories site, "a global snapshot of the railways' impact on all of our lives, collecting stories about rail travel and journeys through the ages: fiction, non-fiction, anecdotes and poems from around the world".
Addendum: I've focused on English literature, but obviously this is just a slice of the genre. Googling, I find Trains and Train Travel in Modern Yiddish Literature (Leah Garrett, Jewish Social Studies 7.2 (2001) 67-88) which analyses a particular historical sub-genre written in Russian during the last days of the shtetl era, when "The third-class train car was the place where Jews from the shtetls and cities of Eastern Europe would, typically, meet, conduct business, speak Yiddish, and talk about their families". This led to works such as the 1890 Shem un Yefes in a vogn (Shem and Japheth on a Train) by Sholem Abramovitsh, the 1911 Ayznban-geshikhtes (Railroad Stories by Sholem Aleichem (whose Tevye and his Daughters was the source text for Fiddler on the Roof) and the 1909 Arum vokzal (At the Depot) by David Bergelson. In this context, Garrett shows the train was portrayed "as a vessel that brings the tides of change into and out of the shtetl" and a negative force of change and modernisation.
Addendum #2: further reading. I've just been exploring greycat, the website of the abovementioned Dr Ralph Harrington, and there's a great deal of interesting material on the topic of railways in literature and general culture. See, particularly, Miniature railways and cultural microsms - railway modelling in Britain, c.1900-c.1950, Victorian railway studies and Ghosts, trains and trams - the technologies of transport in the ghost stories of M. R. James.
Addendum #3, December 2008. Some interesting train-related stuff cropped up this week. One: the Guardian Books blog had a nice feature by Billy Mills - Poster poems: railway lines - about train-related poetry. Two: BBC2 had a good TV programme about trains in literature in film and the appeal of trains, Between the Lines (at the link you can catch it on BBC iPlayer for the next week). Particularly enlightening was the drift from authors seeing trains as scary (fiction fuelled by serious accident rates in early Victorian times) to trains as an efficient means of getting from place to place, with timings often crucial to plots. It was presented by Andrew Martin, who has written a number of detective novels in Edwardian railway settings, as well as some Comment is Free pieces arguing for better marketing for the train, which he thinks could be done by stressing its green credentials and even returning to steam now that current technology could improve the thermodynamic efficiency.