Once you have isolated each track in the arrangement, there are a two different ways to determine the instrument which should play it.
One is that a MIDI meta message with ID 0x04
will appear with the instrument name as a string. See this great page detailing the MIDI file format for details.
The second way is that a MIDI program change message will appear at the beginning of the track. Assuming that the MIDI files are set to use GM (general MIDI) instruments, you can associate data of the program change message to a GM instrument.
Note that program changes are allowed to appear anywhere in a MIDI track, and the sequencer should deal with them accordingly. Although most MIDI files you'll see in the wild won't use program changes in the middle of tracks, keep in mind that it is allowed by the standard and may occur.