Routes
Near the end of the game, I can't build a road even though I have enough wagon cards of the right color
Do you still have enough wagon tokens to build this road?
Stations
At the end of the game, the ticket using a station wasn't validated
First thing to check is: did you have an opponent route to use with this station? The station cannot work on an empty road.
If an opponent route was available, check the game logs (https://boardgamearena.com/gamereview?table=<your table id>) and the logs should tell which route was used for the station. The game automatically uses the best route possible, and it may not be what you expected!
During the game, the ticket using a station wasn't validated
That's perfectly normal, the rules states to use stations to the best advantage at the end of the game. Because during the game, you don't know the best usage of a station yet.