Self-adaptive weights based on balanced residual decay rate for physics-informed neural networks and deep operator networks