Cremation can be done after sunset. In fact, it appears that there exists a Sastric injunction that if one fails to perform the cremation within 10 hours from the time of death then that creates a Dosha which is to be remedied by performing a particular Prayaschitta. So, in certain cases, the cremation has to be done in the night only.
My reference here is the book "Apara Kriyas and Shraddham":
Similarly many other doshas, for which prayaschitta is required, are
listed in Dharma Sastra- vomiting, oozing of blood, passing of urine
and stools while dying or afterwards, wearing dirty dress, failure to
perform Nitya karmas in state of unconsciousness etc., dying in night,
in case of women- impurity of delivery or menses, dying of thunder,
rain, flood, fire, poison etc., and failure to cremate within twenty
five nazhigais (10 hours).
Prayaschitta should be performed for all the doshas and impurities
mentioned earlier and then the applicable Agni should be lit.
Paryushita Prayaschittam should be performed, if cremation is delayed
after death. ‘Paryushita’ means stale, insipid. Sastra prescribes a
maximum of delay of 25 nazhigais (10 hours), if death occurs during
day time and similarly in the night but before 9 nazhigais (i.e.
before 9:45 p.m). If cremation takes place during the night for one
who died in daytime and similarly, during day for one who died in
night, Paryushita Prayaschittam should be performed.
The current practice of postponing cremation long after death occurs
has no sanction in Sastras. It is cruel to the dead person as the Jiva
has already left the body and he is made to experience severe
suffering of not only hunger and thirst but also of separation from
the body he loves which is still on the ground. Hence, cremation
should not be postponed for flimsy reasons like the son is abroad and
has to come etc. It is only for such emergencies that the order of
priority of Kartas has been clearly spelt out in the Sastras. Hence,
cremation should be performed immediately after death occurs, at the
hands of the available Karta in the order of priority. This is very
important.
The Karta should do Vapanam (shave) after cremation is over. He chants
this mantra at that time: मेरुतदर तुल्िन पापािन ििििधािन च ।
केशानािश्य ितष्ठत तस्ात् केशान् िपाम्हम् ॥
“Various types of sins, massive as the Meru and Mandara mountains,
abide in my hairs. Hence I shave off the hairs.” For Gnatis, Vapanam
is on the tenth day. In the case of death of father or mother, even if
it is Friday, and even if cremation occurs in the night, Vapanam and
Pindodaka danam by Karta should be done immediately. In the case of
death of others, the Vapanam should be done the next day.
As the dress of the Preta has been burnt, he feels naked and shy. In
order to avert that feeling, the Karta gives dress required for ten
days with dakshina, ghee, Til, Urid dal, food grains, vegetables and
bronze vessel as Danam to Brahmanas. This is called Nagna Prachchadana
Sraaddham. This should be done immediately after the cremation, if
cremation is done in daytime. If cremation is done in night time, in
the case of father or the mother this Sraaddham should be done
immediately; in the case of others, the next day. After the
Sraaddham, Karta will enter the home along with Gnatis carrying
Deepam. The house should have been purified before the return of the
Karta with cow dung and water and Punyahavachanam.
So, although, as this books says, that there are scriptural injunctions regarding the topic but I was not able to find them directly from some scriptures.