We attended a funeral when my niece & nephew were similar ages - 18mo & just turned 3. They sat between their parents and had colouring in books. Both of them seemed to realise that they needed to be quiet and were very well behaved. For the younger ones, a few board books to look at might keep them occupied long enough for the service.

sorry for your loss.