Your coworker's behavior sounds hurtful. Unfortunately, you will encounter many coworkers over the course of your career that will be standoffish or cold in their interactions with you. This is not necessarily because of anything that you did to them. It could be for a variety of reasons: they are not interested in making friends at work, they are narcissistic, they feel threatened by your presence, or yes, possibly because there is something about you that they don't like, among other reasons. While this is challenging, there is nothing that you can do to prevent it.
In your time at work, you will need to establish boundaries with your coworkers that may be different from the boundaries that you establish in social settings. However, just like in a social setting, spend time with coworkers that make you feel positive and confident, even if they are older than you. When you have to interact with him, keep the conversational professional. If you find that your office requires a lot of social interaction (for example, your team eats lunch together every day), and you are required to interact with him in this setting, then consider asking him questions about himself in order to get to know him better. However, it is generally advisable to avoid talking about very personal or contentious topics with your coworkers unless you have been working with them for a long time, and they have become your "real" friends.
At work, your first priority is to do the best that you can in executing your tasks. If you minimize your social interactions with him, maintain a professional demeanor, and complete your tasks well, then you can build a positive "coworker" relationship with him, even if the two of you are not compatible as "real" friends.
And yes, if this coworker is exhibiting hostile behavior towards you, rather than just a cold demeanor, document it to the best of your ability. This is very useful if you feel that you do need to escalate.