TOKYO—Mario the plumber pulled off two global publicity coups within three weeks, taking a starring role at the Rio Olympic Games’ closing ceremony and at Apple Inc.’s latest iPhone introduction.

Now comes what may be the mustachioed videogame hero’s most difficult feat: boosting profit at the company that created the character, Nintendo Co.

The...