Both are correct but they mean different things The term "best friend" can be it's own title, like roommate or brother. So, "we are best friends" is just stating the title of the relationship you and Tom have.
If you say "Tom and I are the best friends", you are stating that you and Tom are the best at being someone's friend. I could imagine someone saying "You should be friends with Tom and me. Tom and I are the best friends."
Does that help?