Fading LED with multiple sensors issues

I doubt this affects anything, but you have called "Serial.begin" twice.

You seem to have a couple of cases of redundant curly brackets, too, but it looks as though they match correctly. Now, the source of your problem is here:

if(duration < 2000)
{
digitalWrite(ledPin2, fade());
}
if(duration < 1000)
{
digitalWrite(ledPin3, fade());
}
if(duration < 500);
{
digitalWrite(ledPin4, fade());
}

In each of those cases where you call "digitalWrite", you use the return value from the "fade" function. But "fade" is defined as a void function, with no return value. In fact, "fade" contains its own loop and "digital"write", so it looks like it's correctly declared void, but the call should look like this:

if(duration < 2000)
{
fade();
}
if(duration < 1000)
{
fade();
}
if(duration < 500);
{
fade();
}

However, that fails to take into account the different pins that you (seem to) want to fade. So maybe you need to declare "fade" with a single integer parameter that specifies the pin number, and the pass in a pin number when you call it.

BTW, it makes the code a little clearer if you use the "insert code" button when posting. It's the one with the hash symbol "#" on it.