Playing with the work of other artists could have been fun for John Tenniel too. (Of course another reason for the similarity simply could be, that the designs of the train compartmens are similar.)
Bycatch from my Snark hunt:
[left]: John Tenniel: Alice on the Train (1872)
[right]: Augustus Leopold Egg: The Travelling Companions (1862)
There was an old man of Port Grigor,
Whose actions were noted for vigour;
He stood on his head
till his waistcoat turned red,
That eclectic old man of Port Grigor.
He was black in the face,
and they scarcely could trace
The least likeness to what he had been:
While so great was his fright
that his waistcoat turned white –
A wonderful thing to be seen!