Are these two the same when used to express "keep it up" or "survive a little longer"? Also, I often hear people say "hang in there", but I rarely hear people say "hang on there".
"Hang in" means to endure. It's often an exhortation, as in "Hang in there, you'll be alright", but it can be descriptive as well: "Muhammed Ali was winning, but Norton was hanging in there."
"Hang on" can also be an exhortation to endure, but it can also mean, "please wait": "Hang on for a moment while I check". If said forcefully it's a command to slow down or stop. "Now hang on there! That's not what you're supposed to do!"
In the first example, the verb is just 'to hang'. In is a preposition and is used because it has the sense of in the game or in play. So hang in there means 'stay in the situation, don't give up just yet'. I imagine this came about because to the person who is losing their will to stay in, it feels very similar to dangling at the end of a rope with the rope beginning to slip as their grip loosens.
People do say, "Hang on there", or "Hang on a minute", but here the verb is the phrasal verb 'to hang on'. "Hang on there" means 'Stop what you're saying until I can get some clarification from you because I don't believe what you just said.' It can also mean, 'Stop what you're doing because I've just had a completely different thought on how we should approach this, so let's not go any further until I've had a chance to tell you what I was just thinking.'
"Hang on" can also be used when on the phone and you're telling the person on the other end to wait on the line while you step away to go do something.