You do not need to buy your ticket in advance, but you may of course do so Trains in Switzerland are like trains in The Netherlands. They are mass transit. You just buy a ticket and get on. Tickets never sell out.
And just like in The Netherlands a normal ticket is good for a single trip on the route you bought it for, where you are free to take any departure you like.
So just buy a standard, point-to-point ticket from “Basel Airport” to “Neuchatel” good for your arrival day, and you are set.