In the story Thomas Comes to Breakfast, from Branch Line Engines by the Rev. W Awdry, Thomas's driver tells him:
"You know just where to stop, Thomas! You could almost manage without me!"
Thomas, conceited, thinks this is literally true and that he does not need his driver anymore. So he decides to surprise the other engines by coming out of his shed by himself.
However according to the narrator:
Thomas thought he was being clever, but really he was only moving because a careless cleaner had meddled with his controls.
He is unable to stop, and crashes through the the buffers in a siding and into the stationmaster's house.
Here Thomas seems to think that he is moving of his own volition, but in fact his coming out of the shed is caused by something external to him that he is unaware of. It appears that he is mistaken about, or at least overestimates, the degree of free will that he he has.
There is a philosophical school of thought that what seems like free will is a post-hoc explanation our mind creates to explain what has actually been caused by unconscious or external forces. In this episode it seems something like that may be happening with Thomas, although it would be surprising for a conservative clergyman such as the Rev. W Awdry to be associated with a viewpoint such as this, especially since so many of the plots of these stories revolve around moral questions. And the Fat Controller and other railway staff certainly do hold him morally accountable: "You're a very naughty engine, you will stay in the shed until you are wanted" etc.
So, does Thomas the Tank Engine in fact have free will or not?
By free will, I mean that Thomas can realistically choose between alternatives and cause events to take a different course than they otherwise would have. In other words, if Thomas had not been so conceited could he have been expected to stay in the shed?