Hi Scarlet, Welcome to English Forums. Yes, the second sentence, with the second comma, is the correct one. The commas serve to isolate the phrase 'Jason and John', which is in apposition to the subject 'the two main characters'.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.