At the end of the game, can you play a route that is longer than your number of trains?
No, you are limited to the 45 trains you started with.

From the rules, under Claiming a Route (emphasis mine):


  The player may claim a route on the board by playing a set of Train Car cards that match the color and length of the route and then placing one of his colored trains on each space of this route


If you do not have the trains available to place on each space needed then you may not claim the route.

This is also how Days of Wonder's electronic implementation works.