Is there any downsides when mastering a song inside a mix session. It should it always be exported into a stereo track. For an album it’s different but I’m only talking about a single song
Nope, not at all. It’s a common tactic given we live in the age of DAWs. It’s certainly no problem with regard track count. The only thing you might consider is separating the mixing and mastering processes from a standpoint of focusing on one thing at a time and not being tempted to repeatedly go back and tinker. That said, obviously some people enjoy having that option. There’s really no right answer and just go with whatever workflow is best for you personally.
You’re always going to have way more advantages when mixing and mastering at the same time. Albums included. I really don’t understand why some people think otherwise. I suspect it comes from cargo-culting audio production pipelines that existed before DAWs.