Hello,
Well, as you arrive, it will be another hour before you come out of the airport after completing customs & immigration formalities. So that is 12.45 a.m. roughly.
The journey to Negombo city takes 20 minutes by taxi.
The journey from Negombo -> Colombo takes around 1 hour by bus. If you take the expressway, the journey time will be a bit shortened. Anyhow, in order to catch your train by 06.05 a.m. you need to leave Negombo by around 04.45 a.m. But even then it will be better to go by taxi rather than depending on public transport at that time.
So I think the best option will be for you to stay the first night near Colombo station or in Colombo city.
Or else Katunayake city near the airport where the distance to Colombo is shortened / plenty of accommodation choices / is easy to get a taxi.
But if you really wish to stay in Negombo, you can catch the same train from "Veyangoda train station". It takes about 45 min for the train to reach Veyangoda. Then you can leave Negombo city by 05.45 a.m.
Otherwise book accommodation in the city of Veyangoda itself. There a few places there.
As for train ticket booking : you can book the tickets online & receive them at the airport on your arrival. So you will be armed with your tickets any time!