What should be the order of references in a research text?
The order is determined by the standard applied by each journal to their publication. In some cases, references are listed alphabetically in the reference list. In this case, the order of appearance of the numbers in the text may seem random (this is equivalent to your cases 2 and 3). In some cases, references are listed in the order they appear in the text. This yields the first example you provide.

So there is no right or wrong, there are different standards and which you need to follow is given by the journal in which you aim to publish.If you are concerned with which system to use in a report or your thesis, you should simply check with your department or organization to see which they follow. If there are no guidelines, I would suggest the system you find most commonly used in journals that lie close to your subject but you could essentially select whichever one you want as long as it is consistent and logical.