The secret is understanding that a 14-year-old isn't going to quit TikTok just because you told him to, especially if all his friends use it. Pure prohibition really does make things worse, like you guys mentioned, but there's an important detail: you need an agreement that he FEELS he helped create, not something imposed from the top down.
Try this: sit down with him at a time that isn't confrontational (not right after you caught him awake at 3 AM), and sincerely ask why TikTok is so important to him. Let him actually talk, without judgment. Then you build a plan together with time limits - like, no TikTok after 10 PM (because late-night use really does tank performance), nothing during meals or while he's studying. The trade-off matters too: if he sticks to this part, you're not going to be on his case all the time. A lot of people think teenagers need controlled freedom, not prison dressed up as education.
Alongside that, tackle the root of the school problem. If his grades dropped, he's seeing that he gets bad marks but keeps using the same way - that's because the real consequence hasn't actually hit him yet. Maybe having him track his own grades and agreeing that if they drop too much, then you do limit his access (and that comes from him consenting, not you imposing it), works better. And please, don't compare him to what his friends do or don't do - he's tired of hearing that. The focus needs to be on what actually affects HIS life specifically.