Why were dinosaurs not as smart as humans are?
We are all equally evolved

All life that exist on earth today had the exact same amount of time to evolve (3.5 billion years). Therefore, one cannot say that one species is more evolved than another one. It just makes no sense (at least if "more evolved" means "have evolved for more time").

Being a dominant species/clade for some time (whatever dominant may mean to you) doesn't make this species/clade more evolved than any other one.

Your question need not be specific to intelligence

You can think of any other phenotypic trait (wings, toxins in the skin, good eyes, good smell, strong leaves, etc...) and ask this same question. You seem to assume that being smart should be some kind of goal or necessary direction toward which species should evolve. Following your reasoning I would rather ask why the hagfishes, the oyster, the lampreys or the turtles are so dumb although they exist for so long (once again remember that this notion that some lineages have existed longer than others is flawed).

You might also want to have a look at: Why evolution should not be equated with progress?

Being clever is not a goal of evolution

Most of these trait have associated cost to the benefice they might bring. For example having a big brain asks for much energy (20% of ATP in humans) and it also has a cost due to its weight. The sperm whale for example has a brain that weights 7.8 kg. Obviously it is not a big cost for such a big animal to carry heavy organs while it would be impossible for a migratory bird to carry such a brain.

taking different evolutionary path This part is not complete!

Now the question of why Homo sapiens are smart while Tyranosaurus rex are not or why wings evolved in bat and not in mice is rather interesting and hard to answer. I can think of 2 main causes:

1) The newly arising trait (which is usually not the trait you can observe today. Big brain did not appear suddenly, first there were individuals they had slightly bigger brains than the other individuals in the population) is not beneficial over the wildtype trait. There are so many parameters that will affect if a trait is beneficial or not. You can think of the predators, the humidity in the environnement, the social structure, the population size, the type of reproduction, the genetic background etc...

For example, think of a species that is fixed, has no social contact, has nothing it can really predict in the environnement. What would an individual from this species do with a brain? Think of a bird that needs to make food stock for the winter. This bird needs to remember where it hide something. It has been found by the way that some birds have an awesome spatial memory, way better than humans.

2) The trait never happen to occur (or never in a strong enough individual, or never in a population big enough to not suffer from to much drift while the trait is at low frequency) just because the necessary mutation never happen. Mutation is just a random process.

For example. It seems rather hard for a tree to have the necessary mutations to have develop a brain! But we don't need to go to such a extreme example. If you split a population of clone mice in two, the two subpopulation will evolve differently (even in absence of genetic drift (infinite population size)) just because  some mutations occur on one side while some others occur on the other side. Or maybe the same mutation might occur but once in an individual that has low fitness and once in a very fit individual.

Evolution of human cognition abilities

So what are the factors that drive humans to evolve big brains? This question is not solved yet. We have many models to explain this but I don't we have much solutions to test these models. The 2 most common models explain big brains


for social purposes (understanding relationship between other individuals, being able to coordinate the movement for a hunt, etc...) 
due to sexual selection. Being intelligent would be a proxy for having good genes.


For more information concerning the evolution of human cognition, this wikipedia article might be a good start.

UPDATE


  Why do you think mutation is a random process?


Our genetic data are encoded into a succession of 4 types of nucleotide bases (A,T,C and G). A mutation results from a modification of this sequence such as a replacement of a T by a C. These mutations are due to mistakes usually while duplicating the DNA. Most of these mistakes do not affect the fitness (survival + reproduction ability) of the individual, very often these mutation are deleterious and rarely these mutations are beneficial. Some mutations are more probable than others but nevertheless some individuals have a higher mutation rate than others. In order to make things slightly more complicated, some sequences have a higher mutation rate than others. For example, the sequence AAAAAAAAAAAA is more likely to mutate than the sequence ATGTGCATCTA. But even if some mutations are more likely to occur it is still a random process (we couldn't talk about likelihood otherwise!). Two clones living in the exact same environment that both have a baby at the exact same time wil not create babies with the exact same genome given the randomness of mutations. One baby might have a very bad mutation that will make him die, while the other baby might synthesize (=construct) a new enzyme that increases its digestive capacity.