Does a research paper automatically get published online publicly if accepted? Does a research paper automatically get published for the public to read on the journal website if accepted?
That depends on the journal. Some do put accepted articles onto their websites. In most cases, however, the article must first go through some kind of editorial process where the style of the manuscript is adjusted to the requirements of the journal -- for example, many manuscripts are submitted double-spaced, with figures at the end of the manuscript, and this will be converted to single-spaced, maybe double-column, with figures embedded in the text.

But then there are also journals that do not have websites where all articles are posted.

Finally, "publicly posted" can mean quite a lot of things. Some journals actually post a PDF of the article for everyone to read. This is often called "Open Access" these days. On the other hand, most journals are closed access: They will typically post the title, authors, and maybe the abstract of a paper publicly for everyone to see, but the body of the paper is only available for people who either pay for it, or who are with institutions that have (paid) subscriptions to the journal.