Author's Note: This requires a slight change from canon regarding how a Boggart works.
Much shorter than usual, but this differs from the usual Sirius's-innocence-revealed story only in the method.
Professor Lupin proceeded swiftly through the students as each went through the Boggart drill. When his name was called, Ron stepped forward, same as the rest, and -
It hesitated, rippled, and briefly assumed the form of something with eight legs before coalescing into something with two. A man.
"PETER!" he screamed, eyes bulging wildly. "PETER, YOU TRAITOROUS SON OF A -"
Ron's rat dove from his shoulder and, hitting the ground with a squeal, skittered and began to run. "IT WAS YOU!" the man roared as his veins stood out from his neck. "YOU WERE THE SECRET KEEPER! YOU BETRAYED JAMES AND LILY!"
With a growl, he lunged forward, and it was the paws of a great black dog that hit the floor; students screamed and scattered as it charged, foaming at the mouth as it gave chase to the rat. With such a disproportion in size, there was little contest, and just before the classroom door it tossed the rodent into the air, turning its muzzle upwards and opening its maw wide -
The dog went flying into a wall, crumpling its newfound pink tutu, and the rat hit the floor hard. A moment later, a cage of light surrounded it, and Professor Lupin finished his chain of complicated wand-movements with a flourish. He seemed to have, as Muggles would regard it, seen a ghost: he stared at the rat with wide, unseeing eyes, oblivious to the dog staggering about on its hind legs in a parody of ballet.
After what seemed like an eternity of complete silence, he turned back to the class, looking as though he had aged two decades in a single day. "Class is dismissed," he said. "We-" He shook his head, punch-drunk. "We shall resume this lesson next time. I need to be elsewhere. Immediately. I must speak to the Headmaster - I must inform the authorities -"
"What's going on, Professor?" Lavender Brown asked, looking from the Boggart-dog to the rat and back again.
Lupin forced a tremulous, pained smile. "That is the question, isn't it?" He shook his head and passed a hand before his eyes. "That is the question we should have asked long, long before. One we should have done a much better job of asking." He cast another gaze at the imprisoned rat, and a look of agony passed over his shabby features.
"W-what's wrong with Scabbers?" Ron stammered out, his face a sickly white.
"Scabbers?" Professor Lupin gave an exhausted, humorless laugh. "Is that your new nickname, Peter?" he asked, unaccountably turning to the rat, as though it might respond. "I know you never liked Wormtail, but wouldn't you say even that was better?"
Harry's mouth was dry. "Sir?" he choked out, at last finding his voice. "Sir? He was - he said something about 'James and Lily' -"
Professor Lupin turned to Harry, and his face was at once despairing and pitying. "Yes, Harry," he said, "he did. Did you not recognize his face?" The professor shook his head. "It's not the same one in the papers, but it was the one he would have remembered from a dozen years past - Sirius Black."
A loud murmur immediately arose among the students; Professor Lupin raised his voice louder still. "Class is dismissed! Everyone out!" Nobody moved. "I said everyone!"
Though they instinctively moved to obey, their minds would remain in that classroom for some time after...
Author's Note: In canon, the presumed ruling is that Pettigrew's Animagus transformation rendered his mind uninteresting to the Boggart, just as Sirius's Animagus transformation rendered him uninteresting to the Dementors. Here, it didn't; additionally, his continual state of low-level terror caused the Boggart to prioritize him over Ron, and his overwhelming fear caused it to remain 'locked-on' to him even after he was no longer the physically-closest target. After all, what better prey than a rabid coward is there for something that feeds on fear?
The Boggart revealed the truth because, really, can you imagine a more nightmarish scenario for Pettigrew than Sirius attacking him and revealing his true identity and treachery to Remus and a ready-made crowd of credulous witnesses? Neither could the Boggart.