The funeral prayer and the traveller
Question
If a person is travelling along, and on his way he comes upon Muslims burying a deceased, is it now forbidden (haram) for this traveller to go on or not? For some people say that if the traveller does not perform the funeral prayer and does not throw earth and the like, it is haram for this traveller to go on.
Answer
The funeral prayer is a communal obligation (fard kifaya), that is, if some perform it, it falls from the responsibility of all. So if the prayer has already been performed over this deceased, the question of the prayer no longer even arises for the traveller; and if it has not been performed, it is better that this traveller also join the prayer.
Source: Fatawa Mahmudiyya
Preview. The full text opens with JavaScript enabled.