Those even slightly familiar with the life of Martin Scorsese know about his fabled childhood, where little asthmatic Marty became enthralled by the movies, as he was too sickly to play outside with the neighborhood kids. Only Scorsese knows how true this legend exactly is, but the image of him forlornly staring out of his Hell's Kitchen window at the other boys playing on the street is hard not to shake as we watch the lonely orphan Hugo Cabret (Asa Butterfield) hiding in his secret home in the rafters above the Montparnasse train station in 1920s Paris, painstakingly trying to restore an automaton (a mechanical man popular during the Victorian era) for reasons kept secret from us at first.

This automaton gave its name to the children's book on which Hugo is based, Daniel Selznick's The Invention of Hugo Cabret, which is a much better title than the vague and dumbed-down Hugo, but that's a small quibble.

Scorsese – all of whose films, even the failures, are worth seeing – has given us another challenge: a children's film that doesn't seem like it's for children, a movie that looks forward (it's Scorsese's first experiment with 3D) just as it looks back (much of the latter half of the story concerns early French cinema pioneer Georges Méliès, nicely played by Ben Kingsley), and a film that at first seems entirely unlikely to have come from Scorsese – a twinkly, family-friendly holiday movie? – but that ultimately becomes Scorsese's most personal work: As a loving tribute to the value of film historians and a passionate argument for film preservation, it touches on the obsessions closest to the director's heart.

Much of this may come as a surprise to those going to see Hugo as a boy's adventure story, especially as it takes more than an hour to even establish that the "Papa Georges" who operates a toy store at the train station is in fact the great Méliès, but since talk of Méliès and his legacy has dominated most conversations about the film – including those with Scorsese himself – and since Hugo is ultimately all about Méliès, it's a plot twist that I can't exactly keep secret.

Also, while there are some fun chase scenes at the beginning and end of the film, as Hugo continually finds himself on the run from the station's buffoonish inspector (Sacha Baron Cohen, whose slapstick antics in the film's trailer almost kept me away from Hugo, but who turns in a sly, witty and – pardon the pun – even three-dimensional performance), Scorsese takes it rather slow most of the time. As a result, some children may squirm in their seats, and Hugo's two-hour running time won't help.

Finally, as with many Hollywood films nowadays, the script (by John Logan) bogs down at times to let the characters feel sorry for themselves. This bummer trend really should stop – it was also my sole issue with Super 8, J.J. Abrams' own love poem to the movies. But if Hugo is a little too long and unexpectedly morose at times, the last act more than makes up for it.

Scorsese's own giddiness about the early days of cinema is palpable, and certainly his film looks spectacular. The director makes pretty good use of 3D: the great champion of the tracking shot sends his camera through lots of long hallways and tall towers, remembering that 3D's real joy is in the "in your face" effects.

Special mention should also go to the young actress Chloë Grace Moretz, as Hugo's only friend. The star of Kick-Ass, Let Me In, and the upcoming Dark Shadows certainly seems to be making the most out of her childhood stardom, and her British accent – yes, although the movie takes place in Paris, everybody speaks like a Londoner, perhaps because most of the rest of the cast is actually English – is better than those affected by many American actors twice her age. Kudos to her dialect coach. And kudos to Scorsese for giving us a magical film that is so packed with detail and ideas that it's practically tailor-made for repeat viewings.