Answer
✅Answer: Please pay attention to the following narrations:
1 عَنِ الْفَضْلِ بْنِ شَاذَانَ عَنِ الرِّضَا قَالَ: إِنَّمَا جَوَّزْنَا الصَّلَاةَ عَلَى الْمَيِّتِ بِغَيْرِ وُضُوءٍ لِأَنَّهُ لَيْسَ فِيهَا رُكُوعٌ وَ لَا سُجُودٌ وَ إِنَّمَا هِيَ دُعَاءٌ وَ مَسْأَلَةٌ وَ قَدْ يَجُوزُ أَنْ تَدْعُوَ اللَّهَ وَ تَسْأَلَهُ عَلَى أَيِّ حَالٍ كُنْتَ وَ إِنَّمَا يَجِبُ الْوُضُوءُ فِي الصَّلَاةِ الَّتِي فِيهَا رُكُوعٌ وَ سُجُودٌ.
📚Uyun Akhbar al-Reza, Vol. 2, p. 115
Translation: Imam Reza (peace be upon him) said: 'Indeed, we have considered prayer without ablution for the deceased to be permissible because there is no bowing (ruku) or prostration (sujud) in it, and indeed it is a supplication and a request. And indeed, it is permissible for you to call upon God and request from Him in any state you are in. And indeed, ablution is obligatory in a prayer that has bowing and prostration.'
2 عَنِ الْعَلَاءِ عَنْ مُحَمَّدِ بْنِ مُسْلِمٍ عَنْ أَحَدِهِمَا قَالَ: سَأَلْتُهُ عَنِ الرَّجُلِ تَفْجَؤُهُ الْجِنَازَةُ وَ هُوَ عَلَى غَيْرِ طُهْرٍ قَالَ فَلْيُكَبِّرْ مَعَهُمْ.
📚Kafi, Vol. 3, p. 178
Translation: Muhammad ibn Muslim said: 'I asked Imam Baqir or Imam Sadiq (peace be upon them) about a person who suddenly comes across a funeral and does not have ablution.' The Imam said: 'He should say the takbir with them.'
3 عَنْ يُونُسَ بْنِ يَعْقُوبَ قَالَ: سَأَلْتُ أَبَا عَبْدِ اللَّهِ عَنِ الْجِنَازَةِ أُصَلِّي عَلَيْهَا عَلَى غَيْرِ وُضُوءٍ فَقَالَ نَعَمْ إِنَّمَا هُوَ تَكْبِيرٌ وَ تَسْبِيحٌ وَ تَحْمِيدٌ وَ تَهْلِيلٌ كَمَا تُكَبِّرُ وَ تُسَبِّحُ فِي بَيْتِكَ عَلَى غَيْرِ وُضُوءٍ.
📚Kafi, Vol. 3, p. 178
Translation: Yunus ibn Ya'qub said: 'I asked Imam Sadiq (peace be upon him) about the funeral, if I can pray over it without ablution.' He said: 'Yes, indeed it is takbir (saying Allahu Akbar), and tasbih (saying Subhan Allah), and tahmid (saying Alhamdulillah), and tahlil (saying La ilaha illa Allah), just as you say Allahu Akbar and Subhan Allah in your house when you do not have ablution.'
✅It is established from the Shia narrations, of which three examples are mentioned above, that having ablution for the funeral prayer is not obligatory. However, in the following narration, having purity for the funeral prayer is more beloved to the Imam: 👇
4 عَنْ عَبْدِ الْحَمِيدِ بْنِ سَعْدٍ قَالَ: قُلْتُ لِأَبِي الْحَسَنِ الْجِنَازَةُ يُخْرَجُ بِهَا وَ لَسْتُ عَلَى وُضُوءٍ فَإِنْ ذَهَبْتُ أَتَوَضَّأُ فَاتَتْنِي الصَّلَاةُ أَ يُجْزِي لِي أَنْ أُصَلِّيَ عَلَيْهَا وَ أَنَا عَلَى غَيْرِ وُضُوءٍ فَقَالَ تَكُونُ عَلَى طُهْرٍ أَحَبُّ إِلَيَّ
📚Al-Tahdhib, Vol. 3, p. 203
Translation: Abdul Hamid said: 'I said to Abul Hasan (peace be upon him): 'A funeral is brought out, and I do not have ablution, and if I go to perform ablution, the funeral prayer will be missed. Is it sufficient for me to pray over him without ablution?' The Imam said: 'If you are in a state of purity, it is more beloved to me.'
✅If ablution is not possible due to the fear of missing the funeral prayer, one can act upon the following narration:
📚Kafi, Vol. 3, p. 178
5 عَنِ الْحَلَبِيِّ قَالَ: سُئِلَ أَبُو عَبْدِ اللَّهِ عَنِ الرَّجُلِ تُدْرِكُهُ الْجِنَازَةُ وَ هُوَ عَلَى غَيْرِ وُضُوءٍ فَإِنْ ذَهَبَ يَتَوَضَّأُ فَاتَتْهُ الصَّلَاةُ عَلَيْهَا قَالَ يَتَيَمَّمُ وَ يُصَلِّي.
Translation: Halabi said: 'A question was asked to Imam Sadiq (peace be upon him) about a person who comes across a funeral while he is without ablution, and if he goes to perform ablution, the prayer will be missed.' The Imam said: 'He should perform tayammum and pray.'
✅Also, Imam Sadiq (peace be upon him) said in a hadith in 📚Kafi, Vol. 3, p. 178 on the same topic: 'He should strike his hand on a mud wall and perform tayammum.'