Both of these are informal expressions and have multiple meanings:
To take on means:
to attempt to overcome someone or something (e.g. an obstacle or challenge as @DanTheMan says) - I'm going to take on the trail today.
to assume the duties or responsibilities of something - I'm taking on the manager's position.
to assume a specific demeanor or look - His face took on a look of disgust.
To take up means:
to pull or cause to rise upward, particulary with clothing - Can you take up the dress in the back a little?
to clear off or put away - Take up the dishes from the table
to start learning about a skill, hobby, or profession - Jon took up boxing and has been enjoying it.
So really take on is more appropriate, although take up could be used colorfully to express that John is somehow "rising upward" towards the menacing stranger, in a sense.
Also consider this:
take up arms (against someone or something):to prepare to fight
against someone or something.
"Everyone in the town took up arms
against the enemy. They were all so angry that the leader convinced
them to take up arms."
Also, take up the cudgels. Become involved in a conflict, either
physical or verbal, as in "The Kurds took up arms against the Iranians
at least two centuries ago", or "Some believe it's the vice-president's
job to take up the cudgels for the president." The first term
originated in the 1400s in the sense of going to war. The variant,
alluding to cudgels as weapons, has been used figuratively since the
mid-1600s and is probably obsolescent.