You can buy both tickets in Vilnius, but if any doubts about time needed in Paneriai, no worries, buy it on the train from train conductor if the ticket office in Paneriai station is closed. There is no supplement to buy from the conductor if ticket office is closed in Paneriai. Cash only (buying on the train), i think.
You can buy Kaunas-Vilnius ticket once you get to Kaunas train station. Last one is around 10pm.
I went to Paneriai when I was in Vilnius a few years ago. It's well worth the trip, just bear in mind that it is a walk of about one kilometre from the train station to the museum/site - get off the train in Paneriai, turn right out of the station and walk down the road parallel to the railway tracks for 1 km. Easy. There's not a great deal to see but the small museum is fascinating in a gruesome, appalling sort of way ... The actual mass graves are now covered with grass but you can walk among them and imagine the horror. It is a sombre place.
The ticket office at Paneriai station was closed when I went there, but it is easy to buy tickets on Lithuanian trains from the conductor. Just have cash, preferably in small denominations/coins - conductors often don't have enough change for large notes.