The Israeli army is to investigate the deaths of two Palestinian teenagers shot and killed by an Israeli soldier during protests near Gaza border fence.