I can't speak for those specific ferries but October is late season and the ferries for the Amalfi Coast from Salerno were just walk up and get a ticket for the next one in 15 minutes in mid October and we never had to wait. If you are planning going the day of your flight buying timed tickets is always a crapshoot between flight delays, getting out of the airport and to the dock from the airport in time.
The train from Salerno to Napoli is nearly always a locale regional train so for those the price never changes and they technically can't fill up so just show up and take the one you want. They will occasionally be Intercity or fast trains with reserved seats and higher prices but for such a short distance it saves very little time. Whether the price is worth it or just wait 15 or 20 minutes for the next locale is up to you. Fast trains are 20e day of or 5.50e for the locale. There are good food options in the Naples train station food court area.
I always recommend the Trenitalia app for checking schedules and buying tickets.
The best sfogliatelle in the world is 5 minutes from the Naples train station. Sfogliatelle Attanasio under the at Sfogliatelle Calde sign at Vico Ferrovia, 1-2-3-4. Walk over, show up, grab a number right away and wait your turn.
So worth it.
Have a great trip,
=Tod