Billy’s actions at the end
Rewatching the film, I am not exactly sure what Billy was trying to accomplish.
He didn’t need to sneak out from the police station. Just play it cool, get the money and leave. Then he can work to get evidence on Sullivan and the later would never suspect a thing and wouldn’t have erased his file.
Later on, Billy had evidence on Sullivan. With Castello gone, Sullivan was no longer protected.
He could’ve gone to Internal Affairs or even the press. He didn’t need to pull that stunt on the rooftop.