Buses have replaced rail services between Edinburgh Gateway and Inverkeithing as Network Rail carries out the upgrades.