Wholesale prices rose a brisk 0.4 percent in January as higher food costs more than offset declines in energy prices, the government said today.

The rise in the Labor Department's producer price index negated a 0.4 percent decline in December and was the steepest monthly increase since an identical 0.4 percent jump in September.

January's rise, if it persisted for 12 months, would amount to an annual inflation rate of 4.6 percent, compared with the 2.2 percent increase in 1987. Economists, however, still expect that wholesale prices will moderate during the rest of 1988.

Food prices increased 1.7 percent in January, rebounding from a 1.4 percent decline in December.

Analysts said an insect infestation in California and Arizona pushed up vegetable prices, while cold weather influenced a rise in chicken and pork prices.

The increase included a 16.2 percent surge in vegetable prices. Lettuce shot up 51.6 percent in January. That comes atop a 10.5 percent increase in December and a 95.4 percent jump in November. Celery rocketed 44.1 percent and onions 32.5 percent.

Natural gas prices edged up 0.8 percent after a 3 percent increase in December. But steep declines were recorded for other forms of energy, which overall fell 4.5 percent, compared with a decline of 1.6 percent a month earlier.

Gasoline prices fell 8.4 percent after dropping 4.2 percent in December. Home heating oil costs dropped 6.2 percent, compared with a 5.2 percent fall a month before.

Donald Ratajczak, who runs his own inflation surveys as director of economic forecasting at Georgia State University in Atlanta, said falling energy prices reflect "a little bit of a glut" on the oil market.

Minus the usually volatile food and energy categories, the index for all other finished goods rose a brisk 0.5 percent, compared with a 0.2 percent increase in December.

Ratajczak predicts moderate wholesale inflation of 2.6 percent for 1988 and a more robust 3.9 percent in 1989.

"The major thrust of the {1988} increase is ... higher farm prices, especially for the grains, and a slight increase in {energy} prices," he said. " ... Our current estimates suggest that reacceleration of significant inflationary pressures may develop in 1989 as oil prices rise."

The Labor Department gave these other specifics on January wholesale price activity:

New car prices were up 0.2 percent, following a 1.9 percent drop in December.

Alcoholic beverage costs were up 0.1 percent after a 0.3 percent increase a month earlier.

Household appliance prices were down 0.2 percent, compared with a 0.2 percent increase in December.

Home electronic equipment costs fell 0.2 percent after dropping 0.5 percent earlier.

Gains were also posted for adults' and children's clothing and shoes.