There should be some kiosks open at that time. They are at street level, below the platforms. McDonalds will probably be open too. Gdansk Glowny isn't a large station and there a indicator boards (again at street level) so you shouldn't worry about finding your train. You don't need to validate the ticket.