Efficient loop over a integer range in Python
I think that having a range is not necessary here. If you're only comparing against integer ranges, simple \$ \le \$ and \$ \ge \$ comparisons should suffice.
So, the following function is essentially the same:
def search_position(ranges, positions, window_size=10000):
    for low, high, range_id in ranges:
        for pos in positions:
            if low &lt;= pos &lt; high:
                print(pos, range_id, 'exact hit!')
            elif (low - window_size) &lt;= pos &lt; (high + window_size):
                print(pos, range_id, 'neighbour hit!')