It probably refers to in mass production industries, but this is not really a case where grammar alone can tell you the answer; you have to read and interpret the sentence to decide which meaning makes the most sense. In this case I think that unfortunately the sentence is not very well-written, which makes it a little harder.
A where-clause like that usually refers to the closest phrase in the sentence (which here is in mass production industries) but you have to figure out if that is the case or not. Where do you have to repeat the same task? In mass production industries, or in working with automatic machines in mass production industries? Mass production industries certainly involve repeating the same task over and over; that's kind of the definition of mass production. Does working with automatic machines in mass production industries involve repeating the same task? Ehh...maybe, since it's definitely part of mass production industries, which involve repeating the same task over and over, but does working with automatic machines involve repeating the same task over and over? I would say that the simpler interpretation is the better one.
Part of why I think the sentence is not very well-written is that industrial robots are essentially automatic machines; you don't use them to work with automatic machines. So it's not clear why the whole "...in working with automatic machines" phrase is even there, or what it adds to the sentence.