I travelled from Dubrovnik to Split by bus - you pass through Bosnia on the way, so a passpaort is needed (and they do check). And as Medugorie is in Bosnia, this also applies.
Although I have never visitied Medugorie, the bus stops in a town called Metkovic - from memory, you picked up a bus from here to Medugorie.