So, the question circulates about the possibility of having both the world together under one umbrella and compared it. It is playing an important role in each other.
Industry 4.0, as we all know about revolutionizing the industries whereas AI is completely about ruling the world from the perspective of a robot. However, in the technical world, both are impacting one another in a bigger way. Whether it is increasing productivity or improving the scalability and hence the most important thing is the cost reduction.

In my opinion, one of the major obstacles of AI in Industry 4.0 is cost reduction, an important factor for companies. Scalability is also one of the most important factors.
Source:- Bitkom Research; Statista (Was sind aus Sicht Ihres Unternehmens die wichtigsten Vorteile von Künstlicher Intelligenz im Kontext von Industrie 4.0?)