I'm not certain what you are saying. Did you join the line farther up and thus "push ahead"? If so, then yes, I think you were rude. You forced everyone behind them (but ahead of your original position) to be put back one space in line. To me, that's rude.
If, however, you just went to greet them and then returned to your regular place, no problem. I would probably have said, in a slightly loud voice to reassure the people behind them, "I'm just visiting, not getting in line."