Yes, Italian has certain rules on the adjectives order and they are quite strict, in fact. The question appears to be perfectly academic, by the way, because the full set of explanations why un blu treno lungo does not (and could not) sound good takes a doctoral thesis.
So, anybody interested in the perfect and detailed description could consult:
- Ramaglia, Francesca (2008), La sintassi degli aggettivi e la proiezione estesa del NP (tesi di dottorato), Roma, Università degli Studi Roma Tre. (chapter 2.3)
- Cinque, Guglielmo (2010), The Syntax of Adjectives. A comparative study, Cambridge, MA, MIT Press. (chapter 6)
The general scheme of adjectives usage looks like this (adapted from Ramaglia (2008: 131)):
- Functional adjectives: quality - size - time - shape - colour
- Descriptive adjectives: colour - shape - time - size - quality
The first group of adjectives (prenominal) is connotative, implying or suggesting something in addition to the noun. The second group of adjectives (postnominal) is denotative, showing, designing, or indicating something about the noun.
Some adjectives may appear only in one position, either before or after the noun. Always after the noun appear classificatory adjectives and adjectives of provenance/nationality:
- il comitato centrale (never: il centrale comitato)
- un vaso cinese (never: un cinese vaso)
Always before the noun appear such adjectives as presunto, sedicente "alleged", ex "former", futuro "future, next in turn", mero "mere", and some other.
But many adjectives may appear before or after the noun with an inherent change in their meaning. The OP has given two excellent examples with the word piccolo. Such shift in the meaning is even more evident if the same adjective is used both before and after the noun, e.g.:
- un vecchio amico vecchio
- un vecchio amico = a friend since (some point in) the past
- un amico vecchio = a friend, who is old
- un povero uomo povero
- un povero uomo = a poor (=pitiful) man
- un uomo povero = a poor (=with no money) man
- le numerose famiglie numerose che si erano presentate
- numerose famiglie = numerous (=many) families
- le famiglie numerose = the numerous (=with many members) families
For more examples of such adjectives, please refer to the above-mentioned works and to this article.
Now, coming back to the examples from the question:
- un lungo treno blu sounds good because one assesses a type of the train and also describes its color.
- un blu treno lungo could not sound good unless color is a function of this train.
- un verde treno, as proposed by nico in the comments, may sound good if:
- it's in a poetic context (the train is green and blossoming because it's the spring/summer time);
- it implies that this train is young; or
- it implies that the train is sick.