How to merge two arduino sketches, one for relay's and one for Servo motor?
A couple of things stand out in your code.  


Whenever you perform a digital write you assign a value to ledpin:

digitalWrite(ledpin = 3, LOW);


This is not necessary as you do not do anything with the ledpin variable. Instead, just have the digital I/O pin number:

digitalWrite(3, LOW);


Or simply have 2 variables, one for pin 2 and another for pin 3. Eg.

redledpin = 2;
greenledpin = 3;


This also applies to the pinMode function calls in the setup function.
Each one of your  if( Serial.read() == xx) statements will read a serial character off of the serial buffer. Instead store the read character in a local variable:

readChar = Serial.read()
if( readchar == 'a')
...
if( readchar == 'A')
...
if( readchar == 'b')
...
if( readchar == 'B')
... 

I would encase all of the code inside loop() with:

if ( Serial.available() )
{
    ...
}

The delay function is blocking and this will cause issues. I suggest deleting the delay altogether.
Due to the fact that you are sending commands to turn digital outputs on and off as well as sending an integer for motor and another for pos, I suggest that you define a packet structure and make your code follow that (with the necessary error handling). As the code currently stands you will miss information, depending on what character it sees first on the serial buffer.  

I suggest something like:

A, B, 142, 090


Starting the packet off with a know character is a good idea. So is having a timeout period - in case only a portion of your packet is received.